Skip to content

Instantly share code, notes, and snippets.

@dmitrysarov
Last active August 15, 2020 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitrysarov/7149c92d9096397950bbaea4d09b2a56 to your computer and use it in GitHub Desktop.
Save dmitrysarov/7149c92d9096397950bbaea4d09b2a56 to your computer and use it in GitHub Desktop.

devops

Segmentation fault

can you do:

gdb python

and in gdb:

r main.py

And when segfault happens, you can type:

where

Then it will show a stack-trace. Can you paste that here. It'll be helpful to figure out the issue.

Thanks.

git ssh over proxy

Steps:

  1. Make sure that "git remote get-url origin" provide you with ssh url (like git@github.com:USERNAME/REPO)
  2. Probably you have to do apt-get install socat
  3. Make sure that you add ssh public key to github account.

add to ~/.ssh/config

host github.com
    user git
    hostname ssh.github.com
    port 443
    proxycommand socat - PROXY:<PROXY IP>:%h:%p,proxyport=<PROXY PORT>

sudo git pull access issue

sudo call git under root, but ssh key exist under user. do chown -R <USER NAME> .git/

tmux

color schem

add file ~/.tmux.conf with set -g default-terminal "xterm-256color" content

open in same path

set -g prefix C-b
bind-key C-b send-prefix
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
set -g focus-event

bash in tmux with set -o vi by default

add to ~/.bashrc

export VISUAL=vim
export EDITOR="$VISUAL"
set -o vi

bash script

mount ramdisk

PWD=$(pwd)
DIR_NAME="ramdisk"
DIR_PATH="${PWD}/${DIR_NAME}"
if [ -d "$DIR_PATH" ]; then
    $(rm -r $DIR_PATH) 
fi
$(mkdir $DIR_PATH)
echo "$DIR_PATH"
$(mount -t tmpfs -o size=5120m $DIR_NAME $DIR_PATH)

Anyconnect through virtual machine

run proxy server

run squid proxy server 
set allow all for http connection and ssh portin /etc/squid/squid.config
acl SSL_ports port 22
acl SSL_ports port 443
acl Safe_ports port 22
don't forget to sudo service squid restart

for ssh from proxy

Host 130.*
    ProxyCommand corkscrew <proxy_host> <proxy_port> %h %p

for http proxy for certain sites

create .pac file 
put it in web (gist)
use it in macos network settings
https://gist.github.com/dmitrysarov/25c62d7289537d60187d79c0bfb3ce75

GPU memory stuck

sudo nvidia-smi --gpu-reset -i 0

kill -9 $(nvidia-smi | sed -n 's/|\s*[0-9]*\s*\([0-9]*\)\s*.*/\1/p' | sort | uniq | sed '/^$/d')

docker behind the proxy

https://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy

switch off GUI

https://askubuntu.com/questions/1242965/how-to-disable-gui-in-ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment