Skip to content

Instantly share code, notes, and snippets.

View remylavergne's full-sized avatar
🏠
Working from home

Rémy LAVERGNE-PRUDENCE remylavergne

🏠
Working from home
View GitHub Profile
@remylavergne
remylavergne / change-repo-provider.md
Last active January 12, 2020 20:26
[GitHub] Bitbucket to GitHub repository #migration #git #repository

Bitbucket to GitHub

$ git clone --mirror https://bitbucket.org/tommcfarlin/acme-repository.git
$ cd acme-repository
@remylavergne
remylavergne / clean-docker.md
Created November 28, 2019 08:51
[Docker] Clean Docker

Docker Cleaning

Useful commands

Sizes

@remylavergne
remylavergne / shortcuts.md
Last active February 13, 2020 08:35
[Git] Shortcuts and useful commands #cli

Git shortcuts and commands

Search commit from specific user

git log --date=short --branches --since=3.months.ago --author=xyz

Search all commit from comment

@remylavergne
remylavergne / rancher-ubuntu.md
Last active January 25, 2021 11:13
[Rancher] Install Rancher on fresh Ubuntu install

Install Rancher on fresh Ubuntu server install

Provider used : Contabo

Create a sudo user

Never use root as main account.

Access server with ssh.

@remylavergne
remylavergne / nginx-workload-example.yaml
Last active December 8, 2019 20:29
[Rancher] Bind d'un dossier Pod vers le node Host #rancher #volume
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "8"
field.cattle.io/creatorId: user-8xxx7
field.cattle.io/publicEndpoints: '[{"addresses":["xxx.xxx.xxx.135"],"port":32754,"protocol":"TCP","serviceName":"default:nginx-volume-test-nodeport","allNodes":true}]'
creationTimestamp: "2019-12-08T14:27:49Z"
generation: 9
labels:
@remylavergne
remylavergne / useful-commands.md
Created December 10, 2019 10:32
[Kubernetes] Usefull commands #kubectl

Kubernetes commands

Copy files to local host

kubectl cp default/POD_NAME:bin/FILE_NAME /Users/username/FILE_NAME
@remylavergne
remylavergne / android-utils.md
Created March 4, 2020 12:59
[Android] Utils

Bitmap to Byte Array

    suspend fun bitmapToByteArray() = withContext(Dispatchers.Default) {
        val stream = ByteArrayOutputStream()
        imageSelected?.compress(Bitmap.CompressFormat.PNG, 100, stream)
        imageSelectedByteArray = stream.toByteArray()
    }
@remylavergne
remylavergne / ServiceManager.kt
Created March 18, 2020 15:15
[Android] WorkManager snippets
class ServiceManager(private val context: Context) {
private val globalsConstraints =
Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build()
// Add new jobs here
private val allServicesAvailables =
listOf(
Service(IncidentsSynchronizationWorker::class.java, IncidentsSynchronizationWorker.TAG),
Service(AttachmentsCleaningWorker::class.java, AttachmentsCleaningWorker.TAG)
@remylavergne
remylavergne / InternetConnectivity.kt
Created March 18, 2020 20:49
[Android] Internet connectivity
fun isInternetAvailable() {
try {
val command = "ping -c 1 google.com"
if (Runtime.getRuntime().exec(command).waitFor() == 0) {
viewAction.onNext(LauncherAction.InternetAvailable)
} else {
viewAction.onNext(
LauncherAction.NoNetwork(
R.string.launcher_error_no_network_title,
R.string.launcher_error_no_network_message
@remylavergne
remylavergne / disney-cars-2-fix.md
Last active June 14, 2024 06:42
[Windows 10] Disney Pixar Cars 2 game crash fix

Disney Pixar Cars 2 (2011) crash fix

Problems

  • Black screen
  • Music loop stuck
  • Computer freeze (needs a full reboot to work again)
  • Can't play more than one mission

Tested & fixed on Windows 10