94 liens privés
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, …).