197 lines
8.5 KiB
Plaintext
197 lines
8.5 KiB
Plaintext
**screen size** pour 2*2: 137*38 / pour 1*1: 68*19 (37 et 18 si barre des menus cachee)
|
|
**ctrl c** termine l'action en cours du terminal
|
|
**ctrl s** bloque l'affichage du terminal
|
|
**ctrl q** rétablit la communication avec le terminal
|
|
**ctrl z** stop le travail en cours et le met sur pause
|
|
**fg** relance le dernier travail mis sur pause
|
|
**mkdir file{1..10}** creer 10 dossiers nommés de file1 à file10
|
|
**pwd** print working directory
|
|
**xdg-open .** open working directory
|
|
**du -sh** directory sizes
|
|
**ncdu** (visual version of 'du' command) quick presentation of directories size
|
|
|
|
**ssh username@ssh.server.domain -p XXXX** se connecter a un serveur via ssh en precisant un port
|
|
**sftp -P XXXX username@ssh.server.domain** se connecter a un server ssh avec le protocol ftp
|
|
**vim scp://username@ssh.server.domain:XXXX//home/path/to/file** edit a remote file from local vim
|
|
|
|
**pdftotext** transforme un pdf en un fichier texte
|
|
**^** designe le debut d'une ligne
|
|
* n'importe quel caractere autant de fois que possible
|
|
**ls** ** montre tous les dossiers et sous-dossiers recursivement
|
|
**chmod 755 fichier** chmod change les droits des fichiers, organisés en : rwxrwxrwx avec pour valeur r=4 w=2 x=1 donc r-w == r + w == 4 + 1 == 5
|
|
|
|
**zsh**
|
|
**sudo apt-get install zsh**
|
|
**which zsh** donne le chemin d'acces de zsh (/usr/bin/zsh)
|
|
**chsh -s /usr/bin/zsh** change shell (chsh) pour zsh
|
|
(reboot le systeme pour que les changements prennent effet)
|
|
**echo $SHELL** pour voir quel shell est utilisé
|
|
(uncomment **line --DISABLE_AUTO_TITLE="true"--** in ~/.zshrc file pour empecher screen de donner un nom automatique aux sessions)
|
|
|
|
**sass name.scss name.css** create a css file from a scss file
|
|
**sass --watch name.scss:name.css** make the transformations of scss in css file
|
|
|
|
**'tree' like :**
|
|
find | sort | grep -ve "node_modules/" -e ".git/" | sed 's#[^/]*/#|__ #g;s#__ |# |#g;s#| # #g;s#\(node_modules\|.git[ignore]*\)#\1 ...#;$a\ '
|
|
|
|
**format usb**
|
|
**sudo fdisk -l** list all disks - find yours (something like /dev/sdx)
|
|
**sudo fdisk /dev/sdx** enter in fdisk program
|
|
**p** print the partions
|
|
**o** create an empty dos table
|
|
**n** add a new partition
|
|
**p** primary
|
|
**1** partition number 1
|
|
**enter** default first selector
|
|
**+1G** for 1Gb size or *enter* for default
|
|
**a** toogle the flag *bootable*
|
|
**n** again if you want more partitions
|
|
**w** write and quit
|
|
|
|
|
|
|
|
|
|
**touchscreen :**
|
|
**xinput --list** list all input
|
|
**xinput disable 12** disable the input 12, touchscreen for Lenovo-FLEX-3-1120
|
|
**load to start :** add "xinput disable 12" in application autostart
|
|
ADD FORMULA TO FIND 12
|
|
|
|
**appimage :**
|
|
**chmod +x <name>.appimage** make it executable
|
|
(optional) **mv path/Nextcloud-xx.Appimage ~/.local/bin/nextcloud**
|
|
**sudo vim /usr/share/applications/<name>.desktop** create a file.desktop with content :
|
|
[Desktop Entry]
|
|
Exec=/absolute/path/to/file/<name><.ext>
|
|
Name=<name>
|
|
Type=Application
|
|
**( cd /usr/share/applications && chmod 644 <name>.desktop )** maybe change permissions
|
|
|
|
**applications :**
|
|
**ln -s /path/to/executable /usr/bin**
|
|
add /usr/share/applications/<name>.desktop as explained above for appimages
|
|
|
|
**firefox extension source code :**
|
|
**right click on install** and select "copy link"
|
|
**curl -L <link> > /tmp/myextension.xpi** download the extension with curl inside a tmp file
|
|
**unzip /tmp/myextension.xpi -d /tmp/myextension** unzip the content
|
|
enjoy reading it ;)
|
|
|
|
**enable accents on ubuntu :**
|
|
**compose key = right alt** change in keyboard > layout > compose key
|
|
**sudo apt install gnome-tweaks** maybe install tweak to change compose key
|
|
**r-alt ' e** é
|
|
**r-alt ` e** è
|
|
**alternatively :** https://askubuntu.com/questions/1028957/how-to-set-a-compose-key-in-ubuntu-18-04
|
|
**man xkeyboard-config** look for the compose options (shortcut: enter /compose:). You will find
|
|
compose:ralt Right Alt
|
|
compose:lwin Left Win
|
|
compose:lwin-altgr 3rd level of Left Win
|
|
compose:rwin Right Win
|
|
compose:rwin-altgr 3rd level of Right Win
|
|
compose:menu Menu
|
|
compose:menu-altgr 3rd level of Menu
|
|
compose:lctrl Left Ctrl
|
|
compose:lctrl-altgr 3rd level of Left Ctrl
|
|
compose:rctrl Right Ctrl
|
|
compose:rctrl-altgr 3rd level of Right Ctrl
|
|
compose:caps Caps Lock
|
|
compose:caps-altgr 3rd level of Caps Lock
|
|
compose:102 <Less/Greater>
|
|
compose:102-altgr 3rd level of <Less/Greater>
|
|
compose:paus Pause
|
|
compose:prsc PrtSc
|
|
compose:sclk Scroll Lock
|
|
**setxkbmap -option compose:paus** let us say you want to pick Pause as the compose key. Just issue
|
|
**XKBOPTIONS="terminate:ctrl_alt_bksp,compose:paus"** to make it reboot-persistent,
|
|
edit /etc/default/keyboard
|
|
if you had other options already,
|
|
separate them with commas
|
|
|
|
**connect to planet hoster with ssh :**
|
|
ssh hugugtzx@world-370.fr.planethoster.net -p 5022
|
|
**to enable vi :** `export TERM=xterm`
|
|
**locked files on nextcloud :** https://help.nextcloud.com/t/file-is-locked-how-to-unlock/1883
|
|
|
|
**youtube-dl for france.tv :**
|
|
https://github.com/ytdl-org/youtube-dl/issues/29956#issuecomment-1013345689
|
|
|
|
**remap keyboard keys :**
|
|
/* FOR ONE SESSION */
|
|
**xev** open a program that gives informations about key events, like keycode
|
|
**xmodmap -pk | grep <keycode>** to find the name of the key, like Return
|
|
**xmodmap -e "keycode <keycode> = <name>"** ex: `xmodmap -e "keycode 62 = Return"`
|
|
/* OR FOREVER */
|
|
**sudo cp /usr/share/X11/xkb/symbols/pc /usr/share/X11/xkb/symbols/pc.bak** save the file
|
|
**sudo vim /usr/share/X11/xkb/symbols/pc** modify the file
|
|
|
|
**settings of firefox extension MultiTranslate :**
|
|
iframe {
|
|
/*min-width: 720px;*/
|
|
min-height: 600px;
|
|
border: none;
|
|
margin-top: -160px;
|
|
}
|
|
iframe ~ * {
|
|
display: none !important;
|
|
}
|
|
|
|
**open default sites with firefox :**
|
|
https://askubuntu.com/questions/79305/how-do-i-change-my-default-browser
|
|
**sudo update-alternatives --config x-www-browser**
|
|
**sudo update-alternatives --config gnome-www-browser**
|
|
|
|
**change dns :**
|
|
https://learnubuntu.com/change-dns-server/
|
|
so far i just changed in /etc/resolv.conf
|
|
|
|
**format usb :**
|
|
- list disk :
|
|
**df -h** mounted partitions, or
|
|
**lsblk** or
|
|
**sudo fdisk -l** for more informations
|
|
- unmount partitions :
|
|
**sudo umount /dev/sdb1** unmount usb, replace /dev/sdb1 with name of your usb
|
|
- if necessary, erase all memory :
|
|
**sudo dd if=/dev/zero of=/dev/sdb bs=4k status=progress && sync** sync to flush the cache
|
|
- if necessary, erase all partitions or create new ones :
|
|
**sudo fdisk /dev/sdb**
|
|
> Command (m for help): **o** for creating an empty partition table
|
|
> Command (m for help): **n** for creating a new one
|
|
> Select (default p): **<enter>** to select default p
|
|
> Partition number (default 1): **<enter>** to create a partition number 1
|
|
> First sector (default 2048): **<enter>** to start partition at begining
|
|
> Last sector (default xxxxxxxx): **<enter>** to give partition full size
|
|
> Command (m for help): **w** to write the changes (before that, nothing was really made)
|
|
- format partitions (re list before) :
|
|
**sudo mkfs -t vfat -n "<name>" /dev/sdb1** to format in fat32 (vfat) (MaKe FileSystem)
|
|
|
|
|
|
**list of automatic settings :**
|
|
- install screen, omyzsh, keepassxc, curl, make, firefox, signal, gnome-tweaks
|
|
- install or configure to avoid screen blue light
|
|
- install nextcloud client (apt ? or appimage ? appimage need fuse : https://github.com/AppImage/AppImageKit/wiki/FUSE), and launch at startup
|
|
- install these settings (connection with bitbucket ? ssh ? https ?)
|
|
- configure cursor speed, click with touch
|
|
- change dns
|
|
- configure firefox :
|
|
- default browser
|
|
- duckduckgo default search
|
|
- addons :
|
|
- keepassxc
|
|
- i dont care about cookies
|
|
- auto tab discard
|
|
- settings > barre d'outils action click gauche > desactiver tous les autres onglets
|
|
- ublock origin
|
|
- deepl/multitranslate
|
|
- youtube speed control, by toxblh
|
|
- download file
|
|
- password settings
|
|
- setting ctrl-tab to switch to last used tabs
|
|
- configure desktop bar with infos and stats
|
|
- configure git global email and name
|
|
|
|
**todo !**
|
|
- re-add code to move cursor on wrap text in vimrc
|
|
- add vimrc, zshrc, and screenrc in default screen windows
|