Code is more often read than written
– Guido Van Rosssum
Aquí no hay mucho que decir, estamos hablando de Python y por lo tanto aplican las reglas de estilo de Código de Python, debes escribir siguiendo la PEP8. Django también tiene sus propias convenciones para escribir código, estas las puedes encontrar aquí , coteja con las de Python, verás que son complementarias.
tmux new-session -d iftop -m20m -F192.168.2.0/24 -i eth1
tmux split-window -h nload eth1
tmux split-window -v nload enp2s0
tmux split-window -v nload eth2
tmux split-window -v
tmux select-pane 0
tmux -2 attach-session -dThen, after you login with ssh, just run the script. It will create a set of panes and run a command in every pane. Note that this script is just an example, you have to create your own based on it. I know this is not something new, and my sysadmin friends have been using this for a long time, they sure know better options for tmux, you probably will, if that’s the case I would love you to leave a comment with your tips for tmux or better alternatives. Did this post was useful to you?, share it!
1,813 total views, no views today
Host * ControlMaster auto ControlPath ~/.ssh/socket/ssh_mux_%h_%p_%rJust make sure that ~/.ssh/socket/ exists. This will create a socket like ~/.ssh/socket/ssh_mux_localhost_22_markuz and all new connections will use it instead of creating a new connection. Of course, there are some downsides, since the first connection is the only one that is connected, if you loose that connection you’ll disconnect all other ssh instances.You’ll probably do this. So, the way I’ve managed to fix it. Well, it’s kind of simple and of course, it is not magic, just create a master connection whenever you can:
ssh -MNn user@hostPut this somewhere to create it magically (let’s say a script that run in the background), with this you’ll have that ssh connection open, you’ll never have it in the terminal and you’ll not close it until you “kill” that ssh connection. So, the fix is more like a hack, but works, and helps a lot if you are using a lot of connections to a server.
1,921 total views, no views today
$ dd if=/dev/zero of=/swapfile bs=1024 count=655360 $ chmod 00600 /swapfile $ swapon -aThen add it to /etc/fstab. Pretty simple, but you have a big file that may or may not be used in totality. A better approach is to use swapspace daemon, it will create a swap space that will grow/shrink as needed. You can install the service in your VM if you already have it working or, add this to your Vagrantfile to have it done automagically.
config.vm.provision "shell", inline: "sudo apt install swapspace -y"If you do this with a VM already working just shut it down, use vagrant up --provision to run the provision instruction and you are done!. Having a Swap space allows you to reduce the amount of RAM dedicated to your VM.
1,296 total views, no views today
1,115 total views, no views today
wget -O - http://islascruz.org | \ grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' | \ sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//'
617 total views, no views today
I’ve been trying to get Option-arrow keys to move by word in iTerm2. I figured out a solution, but it’s weird. If anyone has an explanation or a better way to do this, let me know.Source: Option-arrow navigation in iTerm2 – BrettTerpstra.com
922 total views, no views today