Howtos

From ZENotes
(Difference between revisions)
Jump to: navigation, search
(Random Whatever:)
(15 intermediate revisions by one user not shown)
Line 1: Line 1:
''these are more recipes, or even just sample of CLI that works in real life.''
+
'''''these are more recipes, or even just sample of CLI that works in real life.'''''
  
Enable Taptaptap on that Red Button. You know you want to
+
Current machine : Model T440s Type 20AR serial PC00L2HW[https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t440s/20ar/20ars32p00/pc00l2hw/parts/display/as-built] , 8G Ram (4G Soldered) 500G sHDD, Transcend 256Go SATA III 6Gb/s MTS430S 42 mm M.2 SSD 430S SSD TS256GMTS430S (instead of 3G Sim transmitter)
 +
 
 +
==Cleanup pacman's cache:==
 +
 
 +
paccache -r[https://wiki.archlinux.org/index.php/Pacman#Cleaning_the_package_cache]
 +
 
 +
== Query both battery states==
 +
 
 +
  upower -i $(upower -e | grep 'BAT1') | egrep 'BAT1|energy' & upower -i $(upower -e | grep 'BAT0') | egrep 'BAT0|energy'
 +
 
 +
 
 +
Add it as alias in .basrc as
 +
 
 +
  alias BATT="upower -i $(upower -e | grep 'BAT1') | egrep 'BAT1|energy' & upower -i $(upower -e | grep 'BAT0') | egrep 'BAT0|energy'"
 +
 
 +
Needs double quotes because of the use of single quote in the command
 +
 
 +
 
 +
==WebDAV to ownCloud==
 +
 
 +
Syntax for Nautilus access through WebDAV towards an owncloud instance :
 +
 
 +
  davs://adress.ofyour.cloud/remote.php/dav/files/nameofuser
 +
 
 +
this will prompt for a username and password and bring you to the root of the File side of things, which is useless. Your actual share is network adress / files /username, not the visibly mounted network share that ony goes to adress.ofyour.cloud/remote/dav (which shows a bunch of stuff you can't do a thing to. be sure to bookmark it the real ./files/usermane location. The system creates a username and impossible password for you, be sure to not use the generic host creds.
 +
 
 +
 
 +
==Force IPV4 GPG keys renewal / finding==
 +
 
 +
Fight stupid GPG keys that won't update other than over an IPV6 address :
 +
 
 +
I ran into this problem on MacOS 10.13.6, and I currently suspect it's something weird with gpg deciding to use IPv6.
 +
 +
I currently don't have a valid global IPv6 address, so all IPv6 addrs should be "no route to host",
 +
but I noticed that if I manually look up keys.gnupg.net and substitute in one of the IPv4 addresses explicitly,
 +
then the command works  and I can proceed, without doing the other workaround with curl.
 +
 +
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
 +
gpg: keyserver receive failed: No route to host
 +
 
 +
$ host keys.gnupg.net
 +
keys.gnupg.net is an alias for hkps.pool.sks-keyservers.net.
 +
hkps.pool.sks-keyservers.net has address 51.38.91.189
 +
[...]
 +
hkps.pool.sks-keyservers.net has IPv6 address 2001:67c:26b4::98:0
 +
 +
$ gpg --keyserver hkp://51.38.91.189 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
 +
gpg: key 105BD0E739499BDB: 4 signatures not checked due to missing keys
 +
gpg: key 105BD0E739499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
 +
gpg: key 3804BB82D39DC0E3: 101 signatures not checked due to missing keys
 +
gpg: key 3804BB82D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported
 +
gpg: no ultimately trusted keys found
 +
gpg: Total number processed: 2
 +
gpg:              imported: 2 
 +
 
 +
replace with an actual output of list of keyserver and the signed key that failed to import. Source : https://github.com/rvm/rvm/issues/4215
 +
 
 +
==> PGP keys need importing:
 +
  -> CC0B7CE9604A8A91F0D70B778489DB248465FDD7, required by: nordselect
 +
==> Import? [Y/n]
 +
:: Importing keys with gpg......
 +
gpg: keyserver receive failed: No route to host
 +
==> Error: Problem importing keys
 +
[jph@ThinkDMX2 ~]$ host keys.gnupg.net
 +
keys.gnupg.net is an alias for hkps.pool.sks-keyservers.net.
 +
hkps.pool.sks-keyservers.net has address 192.146.137.140
 +
[...]
 +
[jph@ThinkDMX2 ~]$ gpg --keyserver hkp://192.146.137.140 --recv-keys CC0B7CE9604A8A91F0D70B778489DB248465FDD7
 +
gpg: key 8489DB248465FDD7: public key "Ward Segers <w@rdsegers.be>" imported
 +
gpg: Total number processed: 1
 +
gpg:              imported: 1
 +
[jph@ThinkDMX2 ~]$ yay nordvpn
 +
 
 +
 
 +
==add a group to user:==
 +
 +
sudo gpasswd -a <user> <group>
 +
 
 +
 
 +
==make a sudo command works without passwd==
 +
 
 +
$USERNAME ALL=NOPASSWD:/path/to/app
 +
 
 +
 
 +
==wget-ftp the fuck out of our public server:==
 +
 
 +
wget -cr ftp://username:password@ftp.provider.org//www/singapore/galleries
 +
 
 +
 
 +
==find UUID of a partition:==
 +
 
 +
ls /dev/disk/by-uuid -l
 +
 
 +
 
 +
==Possibly outdated==
 +
 
 +
===Enable Tap To Click===
 +
 
 +
  synclient TapButton1=1
 +
 
 +
Enable Tap-To-Click on that Red 'nipple' Button. You know you want to
 
   
 
   
 
   su -c 'echo -n 1 >  /sys/devices/platform/i8042/serio1/serio2/press_to_select'   
 
   su -c 'echo -n 1 >  /sys/devices/platform/i8042/serio1/serio2/press_to_select'   
  
Check that hard drive for space-eating goblins:
 
  
  sudo du / -ch -d 1|G
+
===Check that hard drive for space-eating goblins:===
 +
 
 +
  sudo du / -ch -d 1|grep G
 +
 
  
When you can't read your console font
+
===When you can't read your console font===
  
 
  setfont sun12x22
 
  setfont sun12x22
Line 17: Line 119:
 
   synclient FingerHigh=110 FingerLow=100
 
   synclient FingerHigh=110 FingerLow=100
  
Cleanup pacman's cache:
 
  
paccache -r
+
===Control your brightness.===
  
Control your brightness. Well, not yours actually, sorry I can't do that
+
...Well, not yours actually, sorry I can't do that.
  
 
  xbacklight -inc 5'' or'' xbacklight -dec 5
 
  xbacklight -inc 5'' or'' xbacklight -dec 5
  
wget-ftp the fuck out of our public server:
 
  
wget -cr ftp://username:password@ftp.phpnet.org//www/singapore/galleries
+
===Get natural scrolling in i3: ===
 
+
Get natural scrolling in i3:  
+
  
 
  xinput set-button-map 12 1 2 3 5 4 6 7 8 9 10 11 12
 
  xinput set-button-map 12 1 2 3 5 4 6 7 8 9 10 11 12
Line 38: Line 136:
  
  
Test the 6 channels output of a Terratec Aureon 5.1 MkII USB soundcard
+
===Test the 6 channels output of a Terratec Aureon 5.1 MkII USB soundcard===
  
 
  speaker-test -Dsurround51:CARD=Aureon51MkII,DEV=0 -c 6
 
  speaker-test -Dsurround51:CARD=Aureon51MkII,DEV=0 -c 6
  
Convert all .mp3's in a folder to .wav to be able to work on them:
+
 
 +
===Convert !===
 +
 
 +
All .mp3's in a folder to .wav to be able to work on them:
  
 
  for i in *.mp3; do mpg321 -w "`basename "$i" .mp3`".wav "$i"; done
 
  for i in *.mp3; do mpg321 -w "`basename "$i" .mp3`".wav "$i"; done
Line 50: Line 151:
  
 
  for i in *.m4a; do faad -o "`basename "$i" .m4a`".wav "$i"; done
 
  for i in *.m4a; do faad -o "`basename "$i" .m4a`".wav "$i"; done
 +
  
 
Convert .ai in a folder to .wav to be able to work on them:
 
Convert .ai in a folder to .wav to be able to work on them:
Line 55: Line 157:
 
  sox <file>.aif file.wav
 
  sox <file>.aif file.wav
  
add a group to user:
 
 
sudo gpasswd -a <user> <group>
 
  
make a sudo command works without passwd
 
  
$USERNAME ALL=NOPASSWD:/path/to/app
+
==Random Whatever:==
  
find UUID of a partition:
+
Listen to France Inter [https://fluxradios.blogspot.com/ or other radios] :
  
  ls /dev/disk/by-uuid -l
+
  mplayer http://direct.franceinter.fr/live/franceinter-midfi.mp3
  
 
This seems good on X1 :  https://push.cx/2015/dual-booting-arch-linux-on-lenovo-x1-carbon-3rd-gen
 
This seems good on X1 :  https://push.cx/2015/dual-booting-arch-linux-on-lenovo-x1-carbon-3rd-gen

Revision as of 10:20, 10 May 2020

these are more recipes, or even just sample of CLI that works in real life.

Current machine : Model T440s Type 20AR serial PC00L2HW[1] , 8G Ram (4G Soldered) 500G sHDD, Transcend 256Go SATA III 6Gb/s MTS430S 42 mm M.2 SSD 430S SSD TS256GMTS430S (instead of 3G Sim transmitter)

Contents

Cleanup pacman's cache:

paccache -r[2]

Query both battery states

 upower -i $(upower -e | grep 'BAT1') | egrep 'BAT1|energy' & upower -i $(upower -e | grep 'BAT0') | egrep 'BAT0|energy'


Add it as alias in .basrc as

 alias BATT="upower -i $(upower -e | grep 'BAT1') | egrep 'BAT1|energy' & upower -i $(upower -e | grep 'BAT0') | egrep 'BAT0|energy'"

Needs double quotes because of the use of single quote in the command


WebDAV to ownCloud

Syntax for Nautilus access through WebDAV towards an owncloud instance :

 davs://adress.ofyour.cloud/remote.php/dav/files/nameofuser

this will prompt for a username and password and bring you to the root of the File side of things, which is useless. Your actual share is network adress / files /username, not the visibly mounted network share that ony goes to adress.ofyour.cloud/remote/dav (which shows a bunch of stuff you can't do a thing to. be sure to bookmark it the real ./files/usermane location. The system creates a username and impossible password for you, be sure to not use the generic host creds.


Force IPV4 GPG keys renewal / finding

Fight stupid GPG keys that won't update other than over an IPV6 address :

I ran into this problem on MacOS 10.13.6, and I currently suspect it's something weird with gpg deciding to use IPv6.

I currently don't have a valid global IPv6 address, so all IPv6 addrs should be "no route to host", 
but I noticed that if I manually look up keys.gnupg.net and substitute in one of the IPv4 addresses explicitly, 
then the command works  and I can proceed, without doing the other workaround with curl.

$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: keyserver receive failed: No route to host
 
$ host keys.gnupg.net
keys.gnupg.net is an alias for hkps.pool.sks-keyservers.net.
hkps.pool.sks-keyservers.net has address 51.38.91.189 
[...]
hkps.pool.sks-keyservers.net has IPv6 address 2001:67c:26b4::98:0 

$ gpg --keyserver hkp://51.38.91.189 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
gpg: key 105BD0E739499BDB: 4 signatures not checked due to missing keys
gpg: key 105BD0E739499BDB: public key "Piotr Kuczynski <piotr.kuczynski@gmail.com>" imported
gpg: key 3804BB82D39DC0E3: 101 signatures not checked due to missing keys
gpg: key 3804BB82D39DC0E3: public key "Michal Papis (RVM signing) <mpapis@gmail.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg:               imported: 2  

replace with an actual output of list of keyserver and the signed key that failed to import. Source : https://github.com/rvm/rvm/issues/4215

==> PGP keys need importing:
 -> CC0B7CE9604A8A91F0D70B778489DB248465FDD7, required by: nordselect
==> Import? [Y/n] 
:: Importing keys with gpg......
gpg: keyserver receive failed: No route to host
==> Error: Problem importing keys
[jph@ThinkDMX2 ~]$ host keys.gnupg.net
keys.gnupg.net is an alias for hkps.pool.sks-keyservers.net.
hkps.pool.sks-keyservers.net has address 192.146.137.140
[...]
[jph@ThinkDMX2 ~]$ gpg --keyserver hkp://192.146.137.140 --recv-keys CC0B7CE9604A8A91F0D70B778489DB248465FDD7
gpg: key 8489DB248465FDD7: public key "Ward Segers <w@rdsegers.be>" imported
gpg: Total number processed: 1
gpg:               imported: 1
[jph@ThinkDMX2 ~]$ yay nordvpn


add a group to user:

sudo gpasswd -a <user> <group>


make a sudo command works without passwd

$USERNAME ALL=NOPASSWD:/path/to/app


wget-ftp the fuck out of our public server:

wget -cr ftp://username:password@ftp.provider.org//www/singapore/galleries


find UUID of a partition:

ls /dev/disk/by-uuid -l


Possibly outdated

Enable Tap To Click

  synclient TapButton1=1

Enable Tap-To-Click on that Red 'nipple' Button. You know you want to

  su -c 'echo -n 1 >  /sys/devices/platform/i8042/serio1/serio2/press_to_select'  


Check that hard drive for space-eating goblins:

sudo du / -ch -d 1|grep G


When you can't read your console font

setfont sun12x22

Touchpad: increasing the pressure necessary to register touch.

 synclient FingerHigh=110 FingerLow=100


Control your brightness.

...Well, not yours actually, sorry I can't do that.

xbacklight -inc 5 or xbacklight -dec 5


Get natural scrolling in i3:

xinput set-button-map 12 1 2 3 5 4 6 7 8 9 10 11 12
My bashrc alias is  alias natscroll='xinput set-button-map 12 1 2 3 5 4 6 7 8 9 10 11 12 

Want to know what's the keycode to that obscure symbol on your keyboard? Use xev


Test the 6 channels output of a Terratec Aureon 5.1 MkII USB soundcard

speaker-test -Dsurround51:CARD=Aureon51MkII,DEV=0 -c 6


Convert !

All .mp3's in a folder to .wav to be able to work on them:

for i in *.mp3; do mpg321 -w "`basename "$i" .mp3`".wav "$i"; done


Convert all .m4a's in a folder to .wav to be able to work on them:

for i in *.m4a; do faad -o "`basename "$i" .m4a`".wav "$i"; done


Convert .ai in a folder to .wav to be able to work on them:

sox <file>.aif file.wav


Random Whatever:

Listen to France Inter or other radios :

mplayer http://direct.franceinter.fr/live/franceinter-midfi.mp3

This seems good on X1 : https://push.cx/2015/dual-booting-arch-linux-on-lenovo-x1-carbon-3rd-gen

Try to get a flick from your computer to a DVD

Dump the Firefox history sql file

Start X when Log in occurs

Running another X session somewhere else.

The Short Dirty Kernel DIY

Mount mtp devices

Remember AlsaMixer settings

I love Grub1 (Grub 'legacy' now)

A word on SLIM

Use curl to tweet.

Using the CLI to burn an .iso cd.

find stuff.

ffmpeg to convert videos for my phone.

Allow sudo to open up a graphic application as loan modification root from your normal user account or from a root terminal in your normal user account

remount a ro filesystem rw: mount -o remount,rw so that when the system drops you to a shell on boot failure, YOU CAN DO SOMETHING FOR FUCK'S SAKE! And no, it is not in man 8 mount, it isn't.

Connect remotely to a VirtualMachine - how arch-cool is that?

Simple rsync line that works here

MPlayer code to listen to France Inter and other radios, Now, radiotray is cool too.

MPlayer code to watch my QuickCam Communicate STX Webcam See Syntek readme first for stk webcams.

A healthy, fast image gallery starts with reasonably-sized pictures: thanks imagemagick!

Cool ssh

vnc is flawless in Fedora :)

throttling the cpu - mixed results, if for battery life.

Custom Bash - Some Terminal Fun

Calculating Pi

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox