!! re-runs last succsessful command
sudo !!
ctrl - k
kill (cut) to the end of the line
ctrl - y
pastes back whatever was just cut
ctrl - u
kill to the beginning of the line
ctrl - w
kill word
less +F
starts at the end of the file
ctrl-x-e
will put you in your default editor with the cammand ready to edit. Writing and quiting puts the command back in your terminal and executes it
alt .
will give the argument of the last successful command
reset
~ . after you lose connection to a remote ssh session
ctrl-d
ctrl-a
gets you to the beginning of the line
ctrl-e
gets you to the end of the line
ctrl-c
to get out of what you are currently typing without executing
alt-f
moves you forward to the next word delimeter
alt-b
moves you back to the beginning of the word
exec {$SHELL}
history
shows history
ctrl-r
does a reverse search in your history. do ctrl-r, type in your search, keep pressing ctrl-r to keep going back through history
ctrl-g gets you out of the reverse search
ncdu Find files by size, recursively, below the current folder
mkpasswd -l n n = the number of characters in the password
makepasswd --chars=n n = the number of characters in the password
sudo apt-get install bumblebee bumblebee-nvidia primus linux-headers-generic
in grub - nouveau.modeset=0
First remove and purge all existing powerline installations. If you installed with pip install --user you will have to delete the folders in $HOME\.local
Install fonts. Either sudo apt install fonts-powerline or follow instructions here:
https://powerline.readthedocs.io/en/master/installation/linux.html#fonts-installation
Then pip install sudo pip install powerline-status
For bash support add these lines in .bashrc:
if [ -f /usr/local/lib/python3.6/dist-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python3.6/dist-packages/powerline/bindings/bash/powerline.sh
fi
For tmux support add these lines in .tmux.conf:
run-shell "powerline-daemon -q"
source "/usr/local/lib/python3.6/dist-packages/powerline/bindings/tmux/powerline.conf"
For vim support add these lines in .vimrc:
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
push local branch to remote
git push -u origin <local-branch-name>
delete remote branch
$ git push origin --delete <branch_name>
delete local branch
$ git branch -d <branch_name>
get low level settings for desired resolution and refresh rate
$ gtf 2560 1440 30
# 2560x1440 @ 30.00 Hz (GTF) hsync: 43.95 kHz; pclk: 146.27 MHz
Modeline "2560x1440_30.00" 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync
Copy numbers after Modeline "2560x1440_30.00" to end. Then use copied info to create a new mode
$ xrandr --newmode "MODE_NAME" 146.27 2560 2680 2944 3328 1440 1441 1444 1465 -HSync +Vsync
Add new mode to desired monitor. (The monitor name can be found by simply executing $ xrandr)
$ xrandr --addmode MONITOR_NAME MODE_NAME
Switch to new mode
$ xrandr --output MONITOR_NAME --mode MODE_NAME
- If installed, disable pyenv by commenting out
pyenv initin .bashrc - Start new shell
- install pip3
sudo apt install python3-pip - run
pip3 install --upgrade keyrings.alt-> This is the fix - Now install poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - - edit first line of
.poetry/bin/poetry. Change shebang to reference python3#!/usr/bin/env python3 - Now poetry works in the command line
- Re-enable pyenv
- Check in Pycharm. Using poetry in Add Interpreter now working
How to autostart a program on logging in to your desktop
Create an .desktop file in $HOME/.config/autostart/
Documentation - https://specifications.freedesktop.org/desktop-entry-spec/latest/
The File can refer directly to an executable or to a bash script. E.g.
[Desktop Entry]
Type=Application
Name=Default Soundcard
Terminal=true
Exec=/home/erols/bin/my_autostart_script.sh
Icon=system-run
X-GNOME-Autostart-enabled=true
Simple bash script that sets the default soundcard upon logging into the desktop
#! /bin/sh
pactl set-default-sink alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo
pactl set-default-source alsa_input.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo
How to use pact https://wolfgang-ziegler.com/blog/prevent-changing-of-default-ubuntu-sound-device
First, let's get a list of the available audio output devices (sinks) using the pactl command:
$ pactl list short sinks
1 alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1 module-alsa-card.c s16le 2ch 44100Hz IDLE
2 alsa_output.usb-FongLun_AmazonBasics_USB_Conference_Mic_201802-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
3 alsa_output.pci-0000_02_00.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
4 alsa_output.pci-0000_00_1f.3.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
Then do the same for the input devices (sources):
$ pactl list short sources
1 alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
2 alsa_input.usb-Microsoft_Microsoft___LifeCam_HD-5000-02.mono-fallback module-alsa-card.c s16le 1ch 44100Hz IDLE
3 alsa_output.usb-FongLun_AmazonBasics_USB_Conference_Mic_201802-00.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
4 alsa_input.usb-FongLun_AmazonBasics_USB_Conference_Mic_201802-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
5 alsa_output.pci-0000_02_00.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
6 alsa_output.pci-0000_00_1f.3.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz IDLE
Now, using the set-default-sink and set-default-source options of the pactl command, we can set the default input and output devices. This can either be done using the number or the device name (I recommend working with device names however, since those numbers seem to be changing across reboots).
Example:
$ pactl set-default-source alsa_output.pci-0000_00_1f.3.analog-stereo
$ pactl set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo
Was suggested to add to .bashrc in the website. This didn't work for me. I created an autostart desktop entry.