I frequently find myself needing to lookup how to do simple things with Linux and programming all the time. This page serves as a continuously updated repository of useful commands which I need to use frequently:
wget -r -np -nd -l 0 -A.pdf http://security.cs.rpi.edu/courses/binexp-spring2015/lectures/
xrandr --output HDMI-1 --brightness 0.5
# wxh+left+top
# Cropping
mogrify -crop 640x330+0+0 *.jpg
# Resizing
mogrify -resize 640x330+0+0 *.jpg
# Read metadata
exiftool /tmp/my_photo.jpg
# Delete metadata
exiftool -overwrite_original_in_place -all= /tmp/my_photo.jpg
ln -s <src> <dest>
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
git submodule update --init --recursive
# To get a 4mbps video
ffmpeg -i input.mp4 -b 4000k output.mp4
% Add these two lines in your preamble
\input{glyphtounicode}
\pdfgentounicode=1
sudo hexdump -s 56 -e \'"MSDM key: " /29 "%s\n"\' /sys/firmware/acpi/tables/MSDM
# Updates every 0.1s
watch -n 0.1 ls -lt .
timedatectl set-local-rtc 1 --adjust-system-clock
sshfs USER@IP:/$PATH $LOCAL_PATH
ssh-copy-id id@server
# Create a named screen
screen -S myscreen
# Reconnect
screen -r myscreen
# List screens
screen -ls
# Detach
Ctrl+A+D
sudo apt-get install ruby-full build-essential zlib1g-dev
gem install jekyll bundler
bundle install
bundle exec jekyll serve --watch --trace
bundler exec jekyll build && bash -c \'cd _site && python -m http.server 3000\' # workaround for Ruby3
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
# Download and build configuration script from https://github.com/jergusg/k380-function-keys-conf
# Then add the below to the root\'s crontab: * * * * * /home/nic/k380hack.sh
# k380hack.sh
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw0 -f on
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw1 -f on
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw2 -f on
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw3 -f on
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw4 -f on
/home/nic/software/k380-function-keys-conf/k380_conf -d /dev/hidraw5 -f on
# Clean? No. Effective? Yes!
pd.set_option(\'display.max_colwidth\', -1)
# Add this to the first cell of your notebook
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:90% !important; }</style>"))
pip install -r requirements.txt
np.set_printoptions(threshold=np.inf)
# add to beginning of notebook
%load_ext autoreload
%autoreload 2
import numpy as np
from matplotlib import pyplot as plt
from scipy import interpolate
import matplotlib.image as mpimg
import os
import PIL.Image as Image
%load_ext autoreload
%autoreload 2
# wtf is this so hard to remember?
def main():
print("hey there")
if __name__=="__main__":
main()
touch ssh
to enable ssh in /boot
In /boot/wpa_supplicant.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NAME"
scan_ssid=1
psk="PASSWORD"
key_mgmt=WPA-PSK
}
network={
ssid="TELLO-D8A5A9"
key_mgmt=NONE
}
pinout
sudo nmap -sn 192.168.1.0/24
catkin_make -DCMAKE_BUILD_TYPE=Debug
sudo apt install gnome-icon-theme
sudo apt install ffmpegthumbs mplayerthumbs kffmpegthumbnailer kio-extras
# and then enable Previews by going to Dolphin Preferences
sudo apt install kdenetwork-filesharing libsmbclient samba smbclient
# right click to Share folder after this
Uninstall synaptics.
zoom code slack
geany mendeleydesktop