Skip to content

Instantly share code, notes, and snippets.

View letroll's full-sized avatar

Julien Quiévreux letroll

View GitHub Profile
@letroll
letroll / export.sh
Created August 1, 2017 14:08
[add bin in path] add bin in path #path #unix #shell
export PATH=$PATH:~/opt/node/bin
@letroll
letroll / script.sh
Created August 7, 2017 15:21
[run command with specific user] run a command with a specific user #run #command #user #bash #shell #unix
sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"'
@letroll
letroll / help.md
Created August 9, 2017 09:34
[Give write permissions to multiple users on a folder in unix]Give write permissions to multiple users on a folder in unix #permission #write #unix #shell

Users in Linux can belong to more than one group. In this case you want to create a brand new group, let's call it tomandruser:

sudo groupadd tomandruser Now that the group exists, add the two users to it:

sudo usermod -a -G tomandruser tomcat6 sudo usermod -a -G tomandruser ruser Now all that's left is to set the permissions on the directory:

sudo chgrp -R tomandruser /path/to/the/directory

Keybase proof

I hereby claim:

  • I am letroll on github.
  • I am letroll (https://keybase.io/letroll) on keybase.
  • I have a public key ASADHdJ2ZGYNbrAqjwxgzyA9Mw9k5NqjELRy0RNc20DBEwo

To claim this, I am signing this object:

@letroll
letroll / bash.sh
Created February 5, 2018 08:46
[être notifié des connexions/déconnexions adb] Comment faire en bash pour être notifier des connexions <-> déconnexions d'appareils Android #adb #android #bash #netcat
pour être notifié des connexions/déconnexions adb sans poller `adb devices`, on peut parler avec le démon directement :
```netcat localhost 5037 <<< 0012host:track-devices
```
(pratique pour effectuer une action dès qu'un nouveau device est connecté
@letroll
letroll / bash.sh
Last active April 10, 2018 19:37
[xcode select] selection de la version d'Xcode à utiliser #xcode #version #bash #command
//selection la version indiqué
sudo xcode-select -switch /Users/JOHN/Downloads/Xcode45-DP3.app
//affiche le chemin de la version en cours d'utilisation
xcode-select --print-path
@letroll
letroll / bash.sh
Last active April 12, 2018 17:19
[scanner les hosts sur le réseau] Scanner les adresses ip des hosts connectés #nmap #bash #command #network
nmap -sP 192.168.1.0/24
@letroll
letroll / ConditionalDivider.kt
Created March 18, 2019 09:15
[ConditionalDivider] an recyclerview for LinearLayoutManager which support conditional drawing #divider #conditional #recyclerview #android
/**
* ConditionalDivider is a [RecyclerView.ItemDecoration] that can be used as a divider
* between items of a [LinearLayoutManager]. It supports both [.HORIZONTAL] and
* [.VERTICAL] orientations.
*
* <pre>
* dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(),
* mLayoutManager.getOrientation());
* recyclerView.addItemDecoration(dividerItemDecoration);
</pre> *
@letroll
letroll / bash.sh
Created May 4, 2019 20:24
[remove file which filename containing "toto" (recursive)] remove file with filename filter #shell #rm #filter
find . -name "*toto*" -exec rm -f '{}' +
@letroll
letroll / bash.sh
Created May 5, 2019 16:07
[create htaccess]create htaccess #htaccess #password
sudo htpasswd -c .htpasswd username