95 liens privés
Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities.
pass makes managing these individual password files extremely easy. All passwords live in ~/.password-store, and pass provides some nice commands for adding, editing, generating, and retrieving passwords. It is a very short and simple shell script. It's capable of temporarily putting passwords on your clipboard and tracking password changes using git.
You can edit the password store using ordinary unix shell commands alongside the pass command. There are no funky file formats or new paradigms to learn. There is bash completion so that you can simply hit tab to fill in names and commands, as well as completion for zsh and fish available in the completion folder. The very active community has produced many impressive clients and GUIs for other platforms as well as extensions for pass itself.
Test read/write speed of SD/microSD/USB/SSD/HDD.
Bash script for Mac OS X and Linux to test SD/microSD card or SSD/HDD/USB drive read and write speed.
Usage:
$ bash sd_card_speed_test.sh <path to directory which should be tested>
IE: /Volumes/Untitled and not /dev/disk2
Note: administrator password is necessary for sudo to reset file system cache. Read speed result is incorrect without cache reset.
A list of all UTF-8 emojis in bash or zsh
// Paste this code in your console on http://unicode.org/emoji/charts/full-emoji-list.html
const prefix='emoji_'
$$('tr').filter(e =>
e.getElementsByClassName('chars').length > 0
).map(e => {
let chars = e.getElementsByClassName('chars')[0].innerText
if (chars.includes('&zwj')) {
chars = chars.slice(0, chars.indexOf('&z'))
}
let name = e.getElementsByClassName('name')[0].innerText.toLowerCase()
.replace(/[ -]/g, '_')
.replace(/[.:()"“”,’!]/g, '')
.replace('&', 'and')
.replace(/[ãå]/g, 'a')
.replace('é', 'e')
.replace('í', 'i')
.replace('ô', 'o')
.replace('⊛_', '')
.replace('ç', 'c')
.replace('#', 'hashtag')
.replace('*', 'star')
return `${prefix}${name}=${chars}`
}).join("\n")gvfs-mtp
With lsusb you can get information about your device where Bus and Device numbers can be used with gvfs-mtp and device ID for creating of an udev rule.
Bus 002 Device 018: ID 04b7:88a9 Compal Electronics, Inc.
To see detected device with enabled MTP
Use gio mount:
gio mount -li | grep -e ^Volume -e activation_root
Volume(0): MT65xx Android Phone
activation_root=mtp://[usb:002,018]/
Use lsusb:
lsusb -v 2> /dev/null | grep -e Bus -e iInterface -e bInterfaceProtocol
...
Bus 002 Device 018: ID 04b7:88a9 Compal Electronics, Inc.
bInterfaceProtocol 0
iInterface 5 MTP
...
To mount all available connected MTP devices use inline script
gio mount -li | awk -F= '{if(index($2,"mtp") == 1)system("gio mount "$2)}'
To mount or dismount from a command with gvfs-mtp use Bus and Device numbers, e.g. to mount gio mount mtp://[usb:001,007]/ and to unmount gio mount -u mtp://[usb:001,007]/. The mounted device will be available in a directory that begins with mtp:host= and is located under /run/user/$UID/gvfs/.
Nouvelle traduction aujourd’hui, d’un article qui risque sans prévenir de disparaître. La programmation défensive consiste à structurer son code pour limiter au strict minimum les surfaces d’attaques. Le JDN a un article qui résume bien des concepts, mais ici, on va s’attarder sur les scripts Bash. En effet, comme avec PHP on peut vite faire de la merde, et il est préférable de suivre certaines pratiques pour que leur qualité ne soit pas trop catastrophique quand il seront réutilisés ailleurs. Je ne les suis pas toutes, mais j’ai trouvé utile de les partager avec vous.
This article explains how to setup a desktop environment under Linux which will allow you to convert any set of documents to a single multi-pages PDF document. All documents will be merged in alphabetical order according to their filename. Conversion will be accessible straight from the comfort of your Linux file manager (Nautilus, …).