Linux Tips


bash (zsh too) tricks from tutorialLinux

  • sudo !!: re-run previous command in sudo prepended
  • ctrl-k ctrl-u ctrl-w ctrl-y cutting/pasting text
  • less +F /  less then shift-f instead of tail
  • ctrl-x-e to continue editting shell in a text editor
  • alt-. to paste previous command’s argument
  • reset to reset/unbork your terminal
  • ctrl-a. ctrl-e to move to the start and end

bash search exact string

echo “This island is beautiful” | grep -w  is

view all available HDD’s/partitions?

sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

Python locale error: unsupported locale setting:

export LC_ALL=C

in fact, this shit can be solved completely if you understand the locale of your host and remote machine. [todo] – i forgot how it looks like

Lock screen: ‘xscreensaver-command’ -lock

Free Proxies

http://www.publicproxyservers.com/

Free VPN, OpenVPN

http://www.vpnbook.com/freevpn

VirtualBox Ubuntu screen resolution resizable:

sudo apt-get install virtualbox-guest-dkms

multiple Python versions on any distros:

use conda or virtualenv

Repositories Centos Redhat Fedora epel: http://www.rackspace.com/knowledge_center/article/install-epel-and-additional-repositories-on-centos-and-red-hat

Bash cut string substring

$ echo "abcdefghi" | cut -c2-6
bcdef

bashtrick

Create user, change password remotely

http://www.systutorials.com/39549/changing-linux-users-password-in-one-command-line/

Reload static ip address (when the old IP adress still persists):
sudo ifdown <network interface> && sudo ip addr flush <network interface> && sudo ifup <network interface>

https://askubuntu.com/questions/829700/reload-static-ip-ubuntu-16

Facebook Comments

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x