Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lwc:programming:bash [2020/11/27 20:07] – John Harrison | lwc:programming:bash [2024/09/27 12:48] (current) – [Superuser] John Harrison | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | **Comments:** | + | ==== Comments: |
- | Put: : <' | + | Put: |
before the block and put: | before the block and put: | ||
- | COMMENTBLOCK_ORWHATEVERYOUWANTTOCALLME | + | '' |
after the block | after the block | ||
- | **DISPLAY SETTINGS:** | + | ==== DISPLAY SETTINGS: |
* xrandr example: xrandr --output HDMI1 --mode 1280x1024 --right-of eDP1 | * xrandr example: xrandr --output HDMI1 --mode 1280x1024 --right-of eDP1 | ||
* change 1280x1024 display to 1600x1280: | * change 1280x1024 display to 1600x1280: | ||
* shift display down 1280 pixels: | * shift display down 1280 pixels: | ||
- | **FILE MANAGEMENT** | + | ==== FILE MANAGEMENT |
Count # of files in a directory (recursively): | Count # of files in a directory (recursively): | ||
Line 54: | Line 53: | ||
find -type f -exec chmod 664 {} \; | find -type f -exec chmod 664 {} \; | ||
</ | </ | ||
- | |||
copy files recursively, | copy files recursively, | ||
Line 63: | Line 61: | ||
</ | </ | ||
- | **Rip Audio from application using Pulseaudio (no Jack):** | + | ==== Rip Audio from application using Pulseaudio (no Jack): |
get index number of application audio: | get index number of application audio: | ||
- | |||
* pacmd | * pacmd | ||
* list-sink-inputs | * list-sink-inputs | ||
- | |||
assuming index is $INDEX: | assuming index is $INDEX: | ||
- | * pactl load-module module-null-sink sink_name=steam | + | * '' |
- | * pactl move-sink-input $INDEX steam | + | * '' |
- | * parec -d steam.monitor | sox -t raw -r 44k -sLb 16 -c 2 - / | + | * '' |
- | + | === Alternative: | |
- | **VIDEO** | + | * '' |
+ | | ||
+ | | ||
+ | ==== VIDEO ==== | ||
**transcode a video file so it is playable through Windows Media Player (Windows) and Quicktime (MacOS):** | **transcode a video file so it is playable through Windows Media Player (Windows) and Quicktime (MacOS):** | ||
Line 85: | Line 83: | ||
</ | </ | ||
- | **Record Desktop as Video:** | + | ==== Record Desktop as Video: |
The easy way is to use gtk-RecordMyDesktop, | The easy way is to use gtk-RecordMyDesktop, | ||
Line 100: | Line 98: | ||
* if the output file exists, ffmpeg will ask you if you want to overwrite the old file. That's nice, but somehow this throws off the synchronization between the audio and the video. So if you want to overwrite an existing file, delete it first. | * if the output file exists, ffmpeg will ask you if you want to overwrite the old file. That's nice, but somehow this throws off the synchronization between the audio and the video. So if you want to overwrite an existing file, delete it first. | ||
- | **Position of Mouse Cursor:** | + | ==== Position of Mouse Cursor: |
< | < | ||
Line 106: | Line 104: | ||
</ | </ | ||
- | **PRINTING** | + | ==== PRINTING |
add PDF printer to ubuntu intrepid or jaunty (source): | add PDF printer to ubuntu intrepid or jaunty (source): | ||
Line 116: | Line 114: | ||
bmeps seems to be the only way to make a transparent PDF from a PNG file. Directions for building here. | bmeps seems to be the only way to make a transparent PDF from a PNG file. Directions for building here. | ||
- | **PDF** | + | ==== PDF ==== |
convert a grayscale PDF to B&W with Imagemagick: | convert a grayscale PDF to B&W with Imagemagick: | ||
Line 123: | Line 121: | ||
convert -threshold 75% input.pdf output.pdf | convert -threshold 75% input.pdf output.pdf | ||
</ | </ | ||
- | **INTERNET** | ||
- | **ssh no password:** follow [[http:// | + | determine resolution of images inside a pdf: '' |
- | + | ==== INTERNET ==== | |
- | **vpn on Linux 64 bit**: follow [[http://kb.mit.edu/ | + | |
- | + | ||
- | **Remote Desktop (VNC through SSH tunnel)** | + | |
- | + | ||
- | * ssh -L 5901: | + | |
- | * (in a separate terminal): xtightvncviewer -encodings tight localhost:1 | + | |
+ | * **ssh no password:** follow [[http:// | ||
+ | * **vpn on Linux 64 bit**: follow [[http:// | ||
+ | * **Remote Desktop (VNC through SSH tunnel)** | ||
+ | * ssh -L 5901: | ||
+ | * (in a separate terminal): xtightvncviewer -encodings tight localhost:1 | ||
+ | * ssh to a host through another (jump) host | ||
+ | * use '' | ||
+ | * also works for scp i.e. '' | ||
**DHCP Server and Firestarter (on 12.04)** | **DHCP Server and Firestarter (on 12.04)** | ||
- | |||
* sudo apt-get install dhcp3-server | * sudo apt-get install dhcp3-server | ||
* sudo ln -s / | * sudo ln -s / | ||
Line 146: | Line 144: | ||
**Assign card a specific name:** | **Assign card a specific name:** | ||
- | |||
< | < | ||
Line 181: | Line 178: | ||
[[https:// | [[https:// | ||
+ | === check if port is in use === | ||
+ | |||
+ | < | ||
+ | ==== Superuser ==== | ||
+ | === Execute sudo cmd without needing to type password === | ||
+ | == Staying Safe == | ||
+ | - backup ''/ | ||
+ | - leave at least one terminal window open as root | ||
+ | - edit ''/ | ||
+ | == The Magic == | ||
+ | * create a wrapper script that does all your magic for you. Don't add sudo to the cmds in the wrapper script | ||
+ | * using '' | ||
+ | * to execute the cmd without password type '' | ||
+ | ===== Misc ===== | ||
+ | * write to dmesg: '' | ||
+ | * add timestamp to log entries that are piped. Add to pipe: '' | ||
+ | * '' | ||
+ | * remove package with all its dependencies. As root: '' | ||
+ | * [[https:// | ||
+ | * traverse through to see what is using disk space: '' | ||
+ | * find out what app is on a particular port: '' | ||