ssh -D <localport> <user>@<remote host>
and checking if it is working for 'ssh -D 7772 [email protected]'
ssh -o "ProxyCommand nc -x 127.0.0.1:7772 %h %p" [email protected]
ssh -L <localport>:<remote host>:<remote port> <hostname>
ssh -L 28010:vldn337:8010 localhost
from local port 7000 to remote 5005
ssh -L 7000:127.0.0.1:5005 [email protected]
browser(ext_host) -> 134.190.2.5 -> 134.190.200.201
[email protected]:~$ ssh -L 134.190.2.5:8091:134.190.200.201:8091 [email protected]
user@ext_host:~$ wget 134.190.2.5:8091/echo
# ssh -R <remoteport>:<local host name>:<local port> <hostname>
# localy service on port 9092 should be started
# and remotelly you can reach it out just using 127.0.0.1:7777
ssh -R 7777:127.0.0.1:9092 localhost
//TODO
local=======>remote
after that, remote can use local as proxy
first of all start local proxy (proxychains or redsock)
sudo apt install privoxy
sudo vim /etc/privoxy/config
# listen-address 127.0.0.1:9999
# forward-socks5t / http://my-login:[email protected]:8080 .
# forward-socks4a / http://my-login:[email protected]:8080 .
# or
# forward / http://my-login:[email protected]:8080
systemctl start privoxy
# locally proxy server on port 9999 should be started
ssh -D 9999 127.0.0.1 -t ssh -R 7777:127.0.0.1:9999 [email protected]
# from remote machine you can execute
wget -e use_proxy=yes -e http_proxy=127.0.0.1:7777 https://google.com
app_1 --.
\
app_2 --- ---> local proxy <---> External Proxy <---> WWW
... /
app_n --'
install cntlm
# temporarily set proxy variables for curl and brew to work in this session
$ export http_proxy=http://<user>:<password>@proxy-url:proxy-port
$ export https_proxy=$http_proxy
# update & upgrade apt
$ sudo --preserve-env=http_proxy,https_proxy apt-get update
$ sudo --preserve-env=http_proxy,https_proxy apt-get upgrade
# finally, install cntlm
sudo --preserve-env=http_proxy,https_proxy apt-get install cntlm
edit configuration
vim ~/.config/cntlm/cntlm.conf
Username user-name
Domain domain-name
Proxy proxy-url:proxy-port
NoProxy localhost, 127.0.0.*, 10.*, 192.168.*, *.zur
Listen 3128
or globally
sudo vim /etc/cntlm.conf
~/bin/proxy-start.sh
#!/bin/sh
pidfile=~/.config/cntlm/cntlm.pid
if [ -f $pidfile ]; then
kill "$(cat $pidfile)"
sleep 2
fi
cntlm -c ~/.config/cntlm/cntlm.conf -P $pidfile -I
source ~/bin/proxy-settings.sh
proxy_url="http://127.0.0.1:3128"
export http_proxy=$proxy_url
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export _JAVA_OPTIONS="-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3128 -Dhttps.nonProxyHosts=localhost|*.ubsgroup.net|*.muc -Dhttp.nonProxyHosts=localhost|*.ubsgroup.net|*.zur"
check status
sudo invoke-rc.d cntlm status
ss -lt | grep 3128
# open access
ping -s 120 -c 1 146.255.193.66
ping -s 121 -c 1 146.255.193.66
ping -s 122 -c 1 146.255.193.66
# close access
ping -s 123 -c 1 146.255.193.66
open ports, open connections, listening ports, application by port, application port, process port, pid port
# list of open files
sudo lsof -i -P -n | grep LISTEN
# list of open connections
sudo netstat -tulpan | grep LISTEN
# print pid of process that occupying 9999 port
sudo ss -tulpan 'sport = :9999'
sudo mkdir /mnt/vendor-cluster-prod
sudo sshfs -o allow_other,IdentityFile=~/.ssh/id_rsa [email protected]:/remote/path/folder /mnt/vendor-cluster-prod
# sudo fusermount -u /remote/path/folder
# sudo umount /remote/path/folder
sudo apt install curlftpfs
sudo mkdir /mnt/samsung-note
curlftpfs testuser:[email protected]:2221 /mnt/samsung-note/
sudo apt install nfs-common
sudo apt install cifs-utils
sudo mkdir -p /mnt/windows-computer
USER_NAME='my-username'
USER_DOMAIN='ZUR'
USER_SERVER='//u015029.ubsbank.net/home$/x453337/'
sudo mount -t cifs -o auto,gid=$(id -g),uid=$(id -u),username=$USER_NAME,domain=$USER_DOMAIN,vers=2.1 $USER_SERVER /mnt/windows-computer
sudo vim /etc/fstab
/dev/disk/by-uuid/8765-4321 /media/usb-drive vfat 0 0
copy everything from mount
/dev/sdd5 on /media/user1/e91bd98f-7a13-43ef-9dce-60d3a2f15558 type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)
lsblk
fdisk -l
sudo mkfs -t xfs /dev/xvdb
sudo mke2fs /dev/xvdb
kgpg --keyserver keyserver.ubuntu.com --recv-keys 9032CAE4CBFA933A5A2145D5FF97C53F183C045D
gpg --import john-brooks.asc
gpg --verify ricochet-1.1.4-src.tar.bz2.asc
gpg --keyserver keyserver.ubuntu.com --recv-keys D09FB15F1A24768DDF1FA29CCFEEF31651B5FDE8
# generate new RSA keys, create RSA
ssh-keygen -t rsa
( check created file /home/{user}/.ssh/id_rsa )
# if you have copied it, check permissions
chmod 700 ~/.ssh
chmod 700 ~/.ssh/*
ssh-copy-id {username}@{machine ip}:{port}
ssh-copy-id -i ~/.ssh/id_rsa.pub -o StrictHostKeyChecking=no [email protected]
login without typing password
sshpass -p my_password ssh [email protected]
automate copying password
./ssh-copy.expect my_user ubsad00015.vantage.org "my_passw"
#!/usr/bin/expect -f
set user [lindex $argv 0];
set host [lindex $argv 1];
set password [lindex $argv 2];
spawn ssh-copy-id $user@$host
expect "])?"
send "yes\n"
expect "password: "
send "$password\n"
expect eof
sometimes need to add next
ssh-agent bash
ssh-add ~/.ssh/id_dsa or id_rsa
remove credentials ( undo previous command )
ssh-keygen -f "/home/{user}/.ssh/known_hosts" -R "10.140.240.105"
copy ssh key to remote machine, but manually:
cat .ssh/id_rsa.pub | ssh {username}@{ip}:{port} "cat >> ~/.ssh/authorized_keys"
chmod 700 ~/.ssh ;
chmod 600 ~/.ssh/authorized_keys
ssh -o StrictHostKeyChecking=no [email protected]
sshpass -p my_password ssh -o StrictHostKeyChecking=no [email protected]
$ ls ~/.ssh
-rw------- id_rsa
-rw------- id_rsa_bmw
-rw-r--r-- id_rsa_bmw.pub
-rw-r--r-- id_rsa.pub
$ cat ~/.ssh/config
IdentityFile ~/.ssh/id_rsa_bmw
IdentityFile ~/.ssh/id_rsa
# sudo apt install openssh-server
sudo apt install ssh
sudo service ssh start
# sudo systemsctl status ssh
sudo service ssh status
# firewall ubuntu
sudo ufw allow ssh
# configuration
sudo vim /etc/ssh/sshd_config
for enabling/disabling password using
PasswordAuthentication yes
scp filename.txt [email protected]:~/temp/filename-from-local.txt
scp -r [email protected]:~/temp/filename-from-local.txt filename.txt
scp -pr /source/directory user@host:the/target/directory
the same as local copy folder
cp -var /path/to/folder /another/path/to/folder
cp -r --preserve=mode,ownership,timestamps /path/to/src /path/to/dest
cp -r --preserve=all /path/to/src /path/to/dest
# change owner recursively for current folder and subfolders
sudo chown -R $USER .
# local sync
rsync -r /tmp/first-folder/ /tmp/second-folder
# sync remote folder to local ( copy FROM remote )
rsync -avz [email protected]:~/test-2020-02-28 /home/projects/temp/test-2020-02-28
# sync remote folder to local ( copy FROM remote ) with specific port
rsync -avz -e 'ssh -p 2233' [email protected]:~/test-2020-02-28 /home/projects/temp/test-2020-02-28
# sync local folder to remote ( copy TO remote )
rsync -avz /home/projects/temp/test-2020-02-28 [email protected]:~/test-2020-02-28
# sync local folder to remote ( copy TO remote ) include exclude
rsync -avz --include "*.txt" exclude "*.bin" /home/projects/temp/test-2020-02-28 [email protected]:~/test-2020-02-28
function cluster-prod-generation-sync-to(){
if [[ $1 == "" ]]; then
return 1
fi
rsync -avz . $USER_GT_LOGIN@ubsdpd00013.vantage.org:~/$1
}
create directory on remote machine, create folder remotely, ssh execute command, ssh remote execution
ssh user@host "mkdir -p /target/path/"
each_node="bpde00013.ubsbank.org"
REMOTE_SCRIPT="/opt/app/1.sh"
REMOTE_OUTPUT_LOG="/var/log/1.output"
ssh $REMOTE_USER"@"$each_node "nohup $REMOTE_SCRIPT </dev/null > $REMOTE_OUTPUT_LOG 2>&1 &"
sftp -P 2222 my_user@localhost << END_FILE_MARKER
ls
exit
END_FILE_MARKER
# map local /tmp folder to another path/drive
sudo mount -B /tmp /mapped_drive/path/to/tmp
sudo mount /dev/cdrom /mnt
mkdir -p /mnt/my-ram
mount -t tmpfs tmpfs /mnt/my-ram -o size=1024M
watch -n 60 'ls -la | grep archive'
!!
!?flow
. goto-command.sh
pushd
popd
dirs
cd -
shutdown -r now
# simple sort
sort <filename>
# sort by column ( space delimiter )
sort -k 3 <filename>
# sort by column number, with delimiter, with digital value ( 01, 02....10,11 )
sort -g -k 11 -t "/" session.list
# sort with reverse order
sort -r <filename>
cat -n <filename>
split --bytes=1M /path/to/image/image.jpg /path/to/image/prefixForNewImagePieces
cat prefixFiles* > newimage.jpg
cat --lines=17000 big_text_file.txt
uniq -c
print only duplicates ( distinct )
uniq -d
print all duplications
uniq -D
uniq -u
cut --delimiter "," --fields 2,3,4 test1.csv
cut --delimiter "," -f2,3,4 test1.csv
substring with fixed number of chars: from 1.to(15) and 1.to(15) && 20.to(50)
cut -c1-15
cut -c1-15,20-50
/var/log/messages
/var/log/syslog
add-apt-repository ppa:inkscape.dev/stable
you can find additional file into
/etc/apt/sources.list.d
search after adding
apt-cache search inkscape
update from one repo, single update
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/cc-ros-mirror.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
sudo rm /etc/apt/sources.list.d/inkscape.dev*
add space before command
~/.inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
TAB: menu-complete
"\e[Z": menu-complete-backward
set show-all-if-unmodified on
set show-all-if-ambiguous on
# stop execution when non-zero exit
set -e
# stop execution when error happend even inside pipeline
set -eo pipeline
# stop when access to unknown variable
set -u
# print each command before execution
set -x
ctrl+x+e
fc
working folder
pwd
--extra-vars 'rpm_version=$(cat version.txt)'
--extra-vars 'rpm_version=`cat version.txt`'
original.sh $*
folder: /etc/rc1.d ( rc2.d ... )
contains links to ../init.d/<name of bash script>
should understand next options: start, stop, restart
#! /bin/sh
# /etc/init.d/blah
#
# Some things that run always
touch /var/lock/blah
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script blah "
;;
stop)
echo "Stopping script blah"
;;
*)
echo "Usage: /etc/init.d/blah {start|stop}"
exit 1
;;
esac
exit 0
or custom service, service destination
sudo vim /etc/systemd/system/YOUR_SERVICE_NAME.service
Description=GIVE_YOUR_SERVICE_A_DESCRIPTION
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simplesystemctl
ExecStart=YOUR_COMMAND_HERE
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
service with docker container, service dockerized app
[Unit]
Description=Python app
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=5
Restart=always
ExecStartPre=-/usr/bin/docker stop app
ExecStartPre=-/usr/bin/docker rm app
ExecStart=/usr/bin/docker run \
--env-file /home/user/.env.app \
--name app \
--publish 5001:5001 \
appauth
ExecStop=/usr/bin/docker stop app
[Install]
WantedBy=multi-user.target
managing services
# alternative of chkconfig
# alternative of sysv-rc-conf
# list all services
systemctl --all
systemctl enable YOUR_SERVICE_NAME
systemctl start YOUR_SERVICE_NAME
systemctl status YOUR_SERVICE_NAME
systemctl daemon-reload YOUR_SERVICE_NAME
systemctl stop YOUR_SERVICE_NAME
reset X-server, re-start xserver, reset linux gui ubuntu only
Ctrl-Alt-F1
sudo init 3
sudo init 5
sudo pkill X
sudo service lightdm stop
sudo service lightdm force-reload
start
sudo startx
sudo service lightdm start
apt-get install xdotool
xdotool windowactivate $each_window
xdotool key --window $each_window Return alt+f e Down Down Return
file:~/.mc/ini
[Colors]
base_color=normal=brightgray,black:marked=brightcyan,black:selected=black,lightgray:directory=white,black:errors=red,black:executable=brightgreen,black:link=brightblue,black:stalelink=red,black:device=brightmagenta,black:special=brightcyan,black:core=lightgray,black:menu=white,black:menuhot=brightgreen,black:menusel=black,white:editnormal=brightgray,black:editmarked=black,brightgreen:editbold=brightred,cyan
mc --nocolor
ls -lR . | grep ^l
readlink -f {file}
readlink -f `dirname $0`
realpath {file}
or
python -c 'import os.path; print(os.path.realpath("symlinkName"))'
basename {file}
dirname {file}
nautilus "$(dirname -- "$PATH_TO_SVG_CONFLUENCE")"
ls -d <path to folder>/*
find $FOLDER -maxdepth 4 -mindepth 4 | xargs ls -lad
readlink 'path to symlink'
which "program-name"
locate {file name}
exclude DB
/etc/updatedb.conf
locate -ir "brand-reader*"
locate -b "brand-reader"
you need to update filedatabase: /var/lib/mlocate/mlocate.db
sudo updatedb
find . -name "prd-ticket-1508.txt" 2>&1 | grep -v "Permission denied"
find . -name "*.j2" -o -name "*.yaml"
find / -mmin 2
find /tmp -maxdepth 1 -name "native-platform*" -mmin +240 | xargs -I {} sudo rm -r {} \; >/dev/null 2>&1
find /tmp -maxdepth 1 -mmin +240 -iname "[0-9]*\-[0-9]" | xargs -I {} sudo rm -r {} \; >/dev/null 2>&1
find . -type f -size +50000k -exec ls -lh {} \;
find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find . -maxdepth 5 -mindepth 5
find . -type d -name "dist" ! -path "*/node_modules/*"
type <function name>
declare -f <function name>
folder size, dir size, directory size, size directory, size folder size of folder, size of directory
sudo du -shc ./*
sudo du -shc ./* | sort -rh | head -5
df -ha
df -hT /
# size of folder
du -sh /home
# size my sub-folders
du -mh /home
# print first 5 leaders of size-consumers
# slow way: du -a /home | sort -n -r | head -n 5
sudo du -shc ./* | sort -rh | head -5
du -ch /home
# find only files with biggest size ( top 5 )
find -type f -exec du -Sh {} + | sort -rh | head -n 5
yum list {pattern}
( example: yum list python33 )
yum install {package name}
yum repolist all
yum info {package name}
yumdb info {package name}
rpm -qa --last
rpm -qai
rpm -qaic
rpm -qi wd-tomcat8-app-brandserver
fg, bg, jobs
ctrl-Z
bg
ctrl-Z
fg
resume process by number into list 'jobs'
fg 2
bash
exec > output-file.txt
date
# the same as 'exit'
exec <&-
cat output-file.txt
gen_version="5.2.1"
$(find /mapr/dp.prod/vantage/data/processed/gen/$gen_version/ -maxdepth 5 -mindepth 5 | awk -F '/' '{print $14}' > gt-$gen_version.list)
bash
exec ls -la
echo "ls" | xargs -i sh -c "{}"
ctrl-Z
disown -a && exit
for graphical applications DISPLAY must be specified
- using built-in editor
at now + 5 minutes
at> DISPLAY=:0 rifle /path/to/image
^D
- using inline execution
echo "DISPLAY=:0 rifle /path/to/image/task.png" | at now + 1 min
echo "DISPLAY=:0 rifle /path/to/image/task.png" | at 11:01
strace -e open,access <command to run application>
ps fC firefox
pgrep firefox
pid of process by name
pidof <app name>
pidof chrome
windows analogue of 'ps aux'
wmic path win32_process get Caption, Processid, Commandline
output to log stop process
rm -rf -- !(exclude-filename.sh)
youtube-dl --list-formats https://www.youtube.com/watch?v=nhq8e9eE_L8
youtube-dl --format 22 https://www.youtube.com/watch?v=nhq8e9eE_L8
# start recording
# add-apt-repository ppa:savoury1/ffmpeg4 && apt update && apt install -y ffmpeg
ffmpeg -y -video_size 1280x1024 -framerate 20 -f x11grab -i :0.0 /output/out.mp4
# stop recording
ps aux | grep ffmpeg | head -n 1 | awk '{print $2}' | xargs kill --signal INT
You have to escape the % signs with % where is file located
sudo less /var/spool/cron/crontabs/$USER
cron activating
sudo service cron status
all symbols '%' must be converted to '%'
crontab -e
crontab -l
logs
sudo tail -f /var/log/syslog
is cron running
ps -ef | grep cron | grep -v grep
start/stop/restart cron
systemctl start cron
systemctl stop cron
systemctl restart cron
# skip first line in output
docker ps -a | awk '{print $1}' | tail -n +2
./hbase.sh 2>/dev/null
sudo python3 echo.py > out.txt 2>&1 &
sudo python3 echo.py &> out.txt &
sudo python3 echo.py > out.txt &
grep -nr "text for search" .
# need to set * or mask for files in folder !!!
grep -s "search_string" /path/to/folder/*
sed -n 's/^search_string//p' /path/to/folder/*
# grep in current folder
grep -s "search-string" * .*
grep -B 4
grep --before 4
grep -A 4
grep --after 4
oc describe pod/gateway-486-bawfps | awk '/Environment:/,/Mounts:/'
grep -rn '.' -e '@Table'
grep -ilR "@Table" .
cat file.txt | grep -e "occurence1" -e "occurence2"
cat file.txt | grep -e "occurence1\|occurence2"
cat file.txt | grep -e "occurence1" | grep -e "occurence2"
cat file.txt | grep -v "not-include-string"
grep -ir "memory" --include="*.scala"
grep -ir --include=README.md ".*base" 2>/dev/null
grep -ir --include=README.md "base" 2>/dev/null
grep -F -x -f path-to-file1 path-to-file2
grep --fixed-strings --line-regexp -f path-to-file1 path-to-file2
diff -w file1.txt file2.txt
diff -c file1.txt file2.txt
apt install dateutils
dateutils.ddiff -i '%Y%m%d%H%M%S' -f '%y %m %d %H %M %S' 20160312000101 20170817040001
/etc/systemd/timesyncd.conf.d/90-time-sync.conf
[Time]
NTP=ntp.ubuntu.com
FallbackNTP=ntp.ubuntu.com
restart time sync service
timedatectl set-ntp true && systemctl restart systemd-timesyncd.service
array = echo $result | tr {}, ' '
echo "hello World" | tr '[:lower:]' '[:upper:]
echo "hello World 1234 woww" | tr -dc 'a-zA-Z'
sed --in-place 's/LinkedIn/Yahoo/g' *
# replace tab symbol with comma symbol
sed --in-place 's/\t/,/g' one_file.txt
# going to add new line in property file without editor
sed --in-place 's/\[General\]/\[General\]\nenable_trusted_host_check=0/g' matomo-php.ini
urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | tr '[:upper:]' '[:lower:]' | head -n 1
zgrep "message_gateway_integration" /var/lib/brand-server/cache/zip/*.zip
ls -1 *.zip | xargs -I{} unzip -p {} brand.xml | grep instant-limit | grep "\\."
unzip file.zip -d output_folder
unzip -o file.zip -d output_folder
wget -qO- https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz | tar xvz - -C /target/directory
tar zxvf backup.tgz
echo "hello from someone" | tee --append out.txt
echo "hello from someone" | tee --append out.txt > /dev/null
vi wrap( :set wrap, :set nowrap )
shortcut | description |
---|---|
/ | search forward |
? | search backward |
n | next occurence |
N | prev occurence |
export PROMPT_COMMAND="echo -n \[\$(date +%H:%M:%S)\]\ "
.bashrc of ubuntu
if [ "$color_prompt" = yes ]; then
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@$(date +%d%m_%H%M)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='${debian_chroot:+($debian_chroot)}\u:\$(date +%d.%m_%H:%M)\w\$ '
fi
unset color_prompt force_color_prompt
echo $?
cat /proc/meminfo
cat /proc/sys/fs/file-max
mimetype -d {filename}
xdg-open {filename}
w3m {filename}
sensible-browser http://localhost:3000/api/status
# sudo apt-get install imagemagick
identify -verbose image.png
# https://imagemagick.org/script/escape.php
identify -format "%m" image.png # format type
identify -format "%wx%h" image.png # width x height
# sudo apt-get install imagemagick
# without distortion
convert marketing.png -resize 100x100 marketing-100-100.png
# mandatory size, image will be distorted
convert marketing.png -resize 100x100 marketing-100-100.png
# rotate and change quality
convert marketing.png -rotate 90 -charcoal 4 -quality 50 marketing.png
wget -O- http://{host}:8500/wd-only/getBrandXml.jsp?brand=229099017 > /dev/null 2>&1
wget -nv -O- http://{host}:8500/wd-only/getBrandXml.jsp?brand=229099017 2>/dev/null
wget -O out.zip http://{host}:9000/published/resources/10050001.zip
wget http://host:9090/wd-only/1005000.zip --directory-prefix="/home/temp/out"
wget --no-check-certificate https://musan999999.mueq.adas.intel.com:8888/data-api/session/
wget -e use_proxy=yes -e http_proxy=127.0.0.1:7777 https://mail.ubsgroup.net/
or just with settings file "~/.wgetrc"
use_proxy = on
http_proxy = http://username:[email protected]:port/
https_proxy = http://username:[email protected]:port/
ftp_proxy = http://username:[email protected]:port/
zip -r bcm-1003.zip *
zip --junk_paths bcm-1003.zip *
alias sublime_editor=/Applications/SublimeEditor/Sublime
subl(){
sublime_editor "$1" &
}
sed cheat sheet, replace
replace "name" with "nomen" string
sed 's/name/nomen/g'
# replace only second occurence
# echo "there is a test is not a sentence" | sed 's/is/are/2'
example of replacing all occurences in multiply files
for each_file in `find -name "*.java"`; do
sed --in-place 's/vodkafone/cherkavi/g' $each_file
done
locate -ir "/zip$" | sed -n '2p'
/usr/bin/bash^M: bad interpreter: No such file or directory
solution
sed -i -e 's/\r$//' Archi-Ubuntu.sh
ps -aux | awk 'BEGIN{a=0}{a=a+1}END{print a}'
find -cmin -2
curl -u username:password http://example.com
curl --head http://example.com
curl -L http://example.com
curl -X PUT -H "Content-Type: application/vnd.wirecard.brand.apis-v1+json;charset=ISO-8859-1" -H "x-username: cherkavi" [email protected] http://q-brands-app01.wirecard.sys:9000/draft/brands/229099017/model/country-configurations
curl -X POST http://localhost:8983/solr/collection1/update?commit=true -H "Content-Type: application/json" --data '{"add":"data"}'
curl -X POST http://localhost:8983/solr/collection1/update?commit=true -H "Content-Type: application/json" --data-binary '{"add":"data"}'
# or with bash variable
SOME_DATA="my_personal_value"
curl -X POST http://localhost:8983/solr/collection1/update?commit=true -H "Content-Type: application/json" --data-binary '{"add":"'$SOME_DATA'"}'
# or with data from file
curl -X POST http://localhost:8983/test -H "Content-Type: application/json" --data-binary '@/path/to/file.json'
# or with multipart body
curl -i -X POST -H "Content-Type: multipart/form-data" -F "[email protected]" -F "userid=1234" http://mysuperserver/media/upload/
# POST request GET style
curl -X POST "http://localhost:8888/api/v1/notification/subscribe?email=one%40mail.ru&country=2&state=517&city=qWkbs&articles=true&questions=true&listings=true" -H "accept: application/json"
# https://kb.objectrocket.com/elasticsearch/elasticsearch-cheatsheet-of-the-most-important-curl-requests-252
curl -X GET "https://elasticsearch-label-search-prod.vantage.org/autolabel/_search?size=100&q=moto:*&pretty"
- curl -s -X GET http://google.com
- curl --silent -X GET http://google.com
- curl http://google.com 2>/dev/null
curl --insecure -s -X GET http://google.com
curl --verbose --insecure -s -X GET http://google.com
chrome extension cookies.txt
# send predefined cookie to url
curl -b path-to-cookie-file.txt -X GET url.com
# send cookie from command line
curl --cookie "first_cookie=123;second_cookie=456;third_cookie=789" -X GET url.com
# collect cookie from remote url and save in file
curl -c cookie-from-url-com.txt -X GET url.com
curl "http://some.resource/read_book.php?id=66258&p=1" | iconv --from-code WINDOWS-1251 --to-code UTF-8
airflow_trigger(){
SESSION_ID=$1
ENDPOINT=$2
BODY='{"conf":{"session_id":"'$SESSION_ID'","branch":"merge_labels"}}'
curl --silent -w "response-code: %{http_code}\n" --data-binary $BODY -u $AIRFLOW_USER:$AIRFLOW_PASSWORD -X POST $ENDPOINT
return $?
}
DAG_NAME='labeling'
airflow_trigger $each_session "https://airflow.vantage.org/api/experimental/dags/$DAG_NAME/dag_runs"
xmllint --format /path/to/file.xml > /path/to/file-formatted.xml
xmllint --noout file.xml; echo $?
echo output.json | jq .
echo '[{"id": 1, "name": "Arthur", "age": "21"},{"id": 2, "name": "Richard", "age": "32"}]' | \
jq ".[] | .name"
echo '[{"id": 1, "name": "Arthur", "age": "21"},{"id": 2, "name": "Richard", "age": "32"}]' | \
jq '.[] | if .name == "Richard" then . else empty end | [.id, .name] | @csv'
# convert from yaml to json, retrieve values from json, convert to csv
cat temp-pod.yaml | yq - r -j --prettyPrint | jq '[.metadata.namespace, .metadata.name, .spec.template.spec.nodeSelector."kubernetes.io/hostname"] | @csv'
# read value
cat k8s-pod.yaml | yq r - --printMode pv "metadata.name"
# convert to JSON
cat k8s-pod.yaml | yq - r -j --prettyPrint
chmod -R +x <folder name>
find . -name "*.sql" -print0 | xargs -0 chmod 666
mkdir -p some-folder/{1..10}/{one,two,three}
ONE="this is a test"; echo $ONE
activate environment variables from file, env file, export env, export all env, all variable from file, all var export, env var file
FILE_WITH_VAR=.env.local
source $FILE_WITH_VAR
export $(cut -d= -f1 $FILE_WITH_VAR)
# if you have comments in file
source $FILE_WITH_VAR
export `cat $FILE_WITH_VAR | awk -F= '{if($1 !~ "#"){print $1}}'`
/var/log/syslog
sudo http_proxy='http://user:@proxy.muc:8080' apt install meld
remember about escaping bash spec chars ( $,.@.... )
- .bashrc
- /etc/environment
- /etc/systemd/system/docker.service.d/http-proxy.conf
- /etc/apt/auth.conf
Acquire::http::Proxy "http://username:password@proxyhost:port";
Acquire::https::Proxy "http://username:password@proxyhost:port";
- snap
sudo snap set system proxy.http="http://user:[email protected]:8080"
sudo snap set system proxy.https="http://user:[email protected]:8080"
sudo apt list -a [name of the package]
sudo apt list -a kubeadm
dpkg --add-architecture i386
dpkg --print-architecture
dpkg --print-foreign-architectures
sudo apt-get install libglib2.0-0:i386 libgtk2.0-0:i386
apt list <name of package>
sudo apt-get install --only-upgrade {packagename}
sudo apt list
sudo dpkg -l
First letter | desired package state ("selection state") |
---|---|
u | unknown |
i | install |
r | remove/deinstall |
p | purge (remove including config files) |
h | hold |
Second letter | current package state |
---|---|
n | not-installed |
i | installed |
c | config-files (only the config files are installed) |
U | unpacked |
F | half-configured (configuration failed for some reason) |
h | half-installed (installation failed for some reason) |
W | triggers-awaited (package is waiting for a trigger from another package) |
t | triggers-pending (package has been triggered) |
Third letter | error state (you normally shouldn't see a third letter, but a space, instead) |
---|---|
R | reinst-required (package broken, reinstallation required) |
sudo apt-cache madison {package name}
sudo apt-get install {package name}={version}
sudo apt-get clean
sudo apt-get autoremove --purge
sudo apt-get --purge remote {app name}
- sudo invoke-rc.d localkube stop
- sudo invoke-rc.d localkube status ( sudo service localkube status )
- sudo update-rc.d -f localkube remove
- sudo grep -ir /etc -e "kube"
- rm -rf /etc/kubernetes
- rm -rf /etc/systemd/system/localkube.service
- vi /var/log/syslog
echo $?
sudo vmware-installer -u vmware-player
pdftk original.pdf stamp watermark.pdf output output.pdf
- lsb_release -a
- cat /etc/system-release
- uname -a
ip -4 a
ip -6 a
interfaces
sudo ifdown lo && sudo ifup lo
sudo service network-manager restart
nmcli connection
nmcli connection up id {name from previous command}
nmcli connection down id {name of connection}
sudo openconnect --no-proxy {ip-address} --user={user name}
sudo openconnect --no-cert-check --no-proxy {ip-address} --user={user name} ---servercert
example with reading redis collaboration ( package sniffer )
sudo ngrep -W byline -d docker0 -t '' 'port 6379'
# 1------------ 2-------------------- 3--------------
sudo tcpdump -nvX -v src port 6443 and src host 10.140.26.10 and dst port not 22
# and, or, not
# current dns
sudo cat /etc/resolv.conf
# resolving hostname
dig {hostname}
#
systemd-resolve --status
gpg --symmetric {filename}
gpg --decrypt {filename}
- adduser {username} {destination group name}
- edit file /etc/group
add :{username} to the end of line with {groupname}:x:999
sudo useradd test
sudo useradd --create-home test --groups sudo
# set password for new user
sudo passwd test
# set default bash shell
chsh --shell /bin/bash tecmint
sudo adduser vitalii sudo
# close all opened sessions
# after your work done
sudo deluser vitalii sudo
sudo -E bash -c 'python3'
sudo userdel -r test
sudo -E <command>
users
w
who --all
cat /etc/passwd | cut --delimiter=: --fields=1
when you see message:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
use this:
ssh-keygen -R <host>
or
rm ~/.ssh/known_hosts
- proxy local, proxy for user /etc/profile.d/proxy.sh
export HTTP_PROXY=http://webproxy.host:3128
export http_proxy=http://webproxy.host:3128
export HTTPS_PROXY=http://webproxy.host:3128
export https_proxy=http://webproxy.host:3128
export NO_PROXY="localhost,127.0.0.1,.host,.viola.local"
export no_proxy="localhost,127.0.0.1,.host,.viola.local"
Acquire::http::proxy "http://proxy.company.com:80/";
Acquire::https::proxy "https://proxy.company.com:80/";
Acquire::ftp::proxy "ftp://proxy.company.com:80/";
Acquire::socks5::proxy "socks://127.0.0.1:1080/";
http_proxy=http://webproxy.host:3128
no_proxy="localhost,127.0.0.1,.host.de,.viola.local"
create environment for http
sudo gedit /etc/systemd/system/{service name}.service.d/http-proxy.conf
[Service]
Environment="http_proxy=http://user:[email protected]:8080"
create environment for https
sudo gedit /etc/systemd/system/{service name}.service.d/https-proxy.conf
[Service]
Environment="https_proxy=http://user:[email protected]:8080"
restart service, service restart
$ sudo systemctl daemon-reload
$ sudo systemctl restart {service name}
enable automatic start, disable autostart
sudo systemctl enable {service name}
sudo systemctl disable {service name}
service check logs
systemctl status {service name}
journalctl -u {service name} -e
# print all units
journalctl -F _SYSTEMD_UNIT
check settings
systemctl show {service name} | grep proxy
# export SYSTEM_EDITOR="vim"
# export SYSTEMD_EDITOR="vim"
sudo systemctl edit snapd.service
# will edit: /etc/systemd/system/snapd.service.d/override.conf
add next lines
[Service]
Environment=http_proxy=http://proxy:port
Environment=https_proxy=http://proxy:port
restart service
sudo systemctl daemon-reload
sudo systemctl restart snapd.service
sudo snap set system proxy.http="http://user:[email protected]:8080"
sudo snap set system proxy.https="http://user:[email protected]:8080"
# apache server installation, apache server run, web server run, webserver start
sudo su
yum update -y
yum install -y httpd
service httpd start
chkconfig httpd
chkconfig httpd on
vim /var/www/html/index.html
debian
# installation
sudo su
apt update -y
apt install -y apache2
# service
sudo systemctl status apache2.service
sudo systemctl start apache2.service
# change index html
vim /var/www/html/index.html
# Uncomplicated FireWall
ufw app list
ufw allow 'Apache'
ufw status
sudo a2enmod ssl
# sudo a2dismod ssl
# tutorial
vim /usr/share/doc/apache2/README.Debian.gz
# creating self-signed certificates
sudo make-ssl-cert generate-default-snakeoil --force-overwrite
# check certificates
sudo ls -la /etc/ssl/certs/ssl-cert-snakeoil.pem
sudo ls -la /etc/ssl/private/ssl-cert-snakeoil.key
vim /etc/apache2/sites-available/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
sudo service apache2 restart
Another tutorial https://www.digicert.com/easy-csr/openssl.htm https://www.digicert.com/kb/csr-ssl-installation/ubuntu-server-with-apache2-openssl.htm
Generating a RSA private key
openssl req -new -newkey rsa:2048 \
-nodes -out cherkavideveloper.csr \
-keyout cherkavideveloper.key \
-subj "/C=DE/ST=Bavaria/L=München/O=cherkavi/CN=cherkavi developer" \
SSLCertificateFile "/path/to/www.example.com.cert" SSLCertificateKeyFile "/path/to/www.example.com.key"
- ETL
- ETL
- web management - atomicproject.io, cockpit
- install
- guide
- after installation
- use your own user/password
xmodmap -pke
xmodmap -e "keycode 107 = Super_L"
to reset
setxkbmap
create file '~/.Xmodmap'
xev | grep keysym
sudo evtest
sudo evtest /dev/input/event21
content of $HOME/.config/xmodmap-hjkl
keycode 66 = Mode_switch
keysym h = h H Left
keysym l = l L Right
keysym k = k K Up
keysym j = j J Down
execute re-mapping, permanent solution
# vim /etc/profile
xmodmap $HOME/.config/xmodmap-hjkl
setxkbmap -option
set-title(){
ORIG=$PS1
TITLE="\e]2;$@\a"
PS1=${ORIG}${TITLE}
}
set-title "my title for terminal"
base64 cAdvisor-start.sh | base64 --decode
echo "just a text string" | base64 | base64 --decode
md5sum
sudo dmidecode --string system-serial-number
sudo dmidecode --string processor-family
sudo dmidecode --string system-manufacturer
tool installation
sudo apt install xinput-calibrator
configuration
xinput_calibration
list of all devices, device list, list of devices
xinput --list
cat /proc/bus/input/devices
permanent applying
vi /usr/share/X11/xorg.conf.d/80-touch.conf
disable device
xinput --disable {number from command --list}
# check input source - use name(s) for next command
xinput
# create file and add content
sudo vim /usr/share/X11/xorg.conf.d/50-thinkpad.conf
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "Lenovo ThinkPad Compact USB Keyboard with TrackPoint|ThinkPad Extra Buttons"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
sudo fdisk -l
sudo lsblk
sudo fsck /dev/sdb
e2fsck -b 32768 /dev/sdb
sudo e2fsck -b 32768 /dev/sdb
sudo dd if=/dev/zero of=/dev/sdb
sudo fdisk /dev/sdb
sudo partprobe -s
sudo mkfs.vfat -F 32 /dev/sdb
sudo dd if=/dev/zero of=/dev/sdb bs=512 count=1
sudo fdisk /dev/sdb
sox -n dtmf-1.wav synth 0.1 sine 697 sine 1209 channels 1
sox -n dtmf-2.wav synth 0.1 sine 697 sine 1336 channels 1
sox -n dtmf-3.wav synth 0.1 sine 697 sine 1477 channels 1
convert -geometry 400x600 -density 100x100 -quality 100 test-pdf.pdf test-pdf.jpg
barcode -o 1112.pdf -e "code39" -b "1112" -u "mm" -g 50x50
http://goqr.me/api/doc/create-qr-code/
http://api.qrserver.com/v1/create-qr-code/?data=HelloWorld!&size=100x100
apt install zbar-tool
zbarimg <file>
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf test-pdf2.pdf test-pdf3.pdf test-pdf4.pdf
bzip2 -dc ricochet-1.1.4-src.tar.bz2 | tar xvf -
alias clipboard="xclip -selection clipboard"
alias clipboard-ingest="xclip -selection clipboard"
function clipboard-copy-file(){
xclip -in -selection c $1
}
alias clipboard-print="xclip -out -selection clipboard"
# connect and disconnect headphones
bluetoothctl connect 00:18:09:EC:BE:FD
bluetoothctl disconnect 00:18:09:EC:BE:FD
# for manual
sudo apt install bluez-tools
bt-device --list
bt-device --disconnect 00:18:09:EC:BE:FD
bt-device --connect 00:18:09:EC:BE:FD
screenshot(){
file_name="/home/user/Pictures/screenshots/screenshot_"`date +%Y%m%d_%H%M%S`".png"
scrot $file_name -s -e "xdg-open $file_name"
}
http://cups.org - printer installation http://localhost:631/admin in case of authorization issue:
/etc/cups/cupsd.conf and changed the AuthType to None and commented the Require user @SYSTEM:
<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
AuthType None
# AuthType Default
# Require user @SYSTEM
Order deny,allow
</Limit>
and restart the service
sudo service cups restart
dmesg --level=err,warn
dmesg --follow
# save all messages /var/log/dmesg
dmesg -S
ncdu
# list of all hard drives, disk list
sudo lshw -class disk -short
# write image
sudo dd bs=4M if=/home/my-user/Downloads/archlinux-2019.07.01-x86_64.iso of=/dev/sdb status=progress && sync
STARTTIME=$SECONDS
sleep 2
echo $SECONDS-$STARTTIME
STARTTIME=`date +%s.%N`
sleep 2.5
ENDTIME=`date +%s.%N`
TIMEDIFF=`echo "$ENDTIME - $STARTTIME" | bc | awk -F"." '{print $1"."substr($2,1,3)}'`
sudo apt-get install translate-shell
trans -source de -target ru -brief "german sentance"
sox 1.wav 2.wav 3.wav 4.wav output.wav
ffmpeg -i 1.wav -i 2.wav -i 3.wav output.wav
.bashrc - .bash_profile
brew
sudo awk -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd > passwd-export
sudo awk -F: '($3>=LIMIT) && ($3!=65534)' /etc/group > /opt/group-export
sudo awk -F: '($3>=LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - | egrep -f - /etc/shadow > /opt/shadow-export
sudo cp /etc/gshadow /opt/gshadow-export
# sudo apt-get install sqlite3
cat src/scripts.sql | sqlite3 src/db.sqlite
\x27
example:
a=$((a+`zip_textfiles part_0 part_0.txt | awk '{if(NF>=5){print $4"/"$5}}' | awk -F '/' '{print $14" "$15"/"$16"/"$17" "$18}' | python sql-update-files-with-md5sum.py`))
awk '{print "a=$((a+`zip_textfiles "$2" "$2".txt | awk \x27 "}'
| awk -F \'/\' \'{print $14\" \"$15\"/\"$16\"/\"$17\" \"$18}\' | python sql-update-files-with-md5sum.py\`)); echo \"update "$2".txt"}' > update-db-from-files.sh
head completed2.files.list | awk -F '/' '{print substr($0, 1, length($0) - length($NF))}'
awk -F '<new delimiter>'
example of multi delimiter:
awk -F '[/, ]'
example of determination delimiter in code
awk 'BEGIN{FS=",";}{print $2}'
awk '{print NF}'
awk '{print $NF}'
awk '{print NR}'
awk 'BEGIN{OFS="<=>"}{print $1,$2,$3}'
ps -aux | awk '{if(index($1,"a.vcherk")>0){print $0}}'
ps -aux | awk '{print substr($0,1,20)}'
awk -f <filename>
print($NF)
print($0)
BEGIN{
need_to_print = 0
}
{
if(need_to_print >0){
print $N
need_to_print = need_to_print - 1
}else{
if( index($N, "Exception")>0 && index($N, "WrongException")==0 ) {
if(index($N,"[ERROR")==1 || index($N,"[WARN")==1){
print $N
need_to_print = 3
}
}
}
}
find . -name "*.java" -ls | awk '{byte_size += $7} END{print byte_size}'
du -hs * | sort -h
rm -rf .gnome .gnome2 .gconf .gconfd .metacity .cache .dbus .dmrc .mission-control .thumbnails ~/.config/dconf/user ~.compiz*
alt-F2 r
dconf-editor
gnome keybinding
/org/gnome/desktop/wm/keybindings
gnome-shell --version
path_to_extension=~/Downloads/switcherlandau.fi.v28.shell-extension.zip
plugin_uuid=`unzip -c $path_to_extension metadata.json | grep uuid | cut -d \" -f4`
plugin_dir="$HOME/.local/share/gnome-shell/extensions/$plugin_uuid"
mkdir -p $plugin_dir
unzip -q $path_to_extension -d $plugin_dir/
sudo systemctl restart gdm
sudo ubuntu-drivers autoinstall
echo 'password' | sudo -S bash -c "echo 2 > /sys/module/hid_apple/parameters/fnmode"
echo 'options hid_apple fnmode=2 iso_layout=0 swap_opt_cmd=0' | sudo tee /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all
xdg-mime query default x-scheme-handler/http
open in default browser
x-www-browser http://localhost:9090
rifle <path to file>
sudo apt-get install haskell-stack
stack upgrade
stack install toodles
sudo apt install byobu
sudo dpkg --add-architecture i386
dpkg --add-architecture i386
dpkg --print-architecture
dpkg --print-foreign-architectures
#sudo apt-get install ia32-libs ia32-libs-i386 libglib2.0-0:i386 libgtk2.0-0:i386
sudo apt-get install libglib2.0-0:i386 libgtk2.0-0:i386
sudo apt-get install gcc-multilib
sudo apt-get install libwebkit-1.0-2:i386 libwebkitgtk-1.0-0:i386
sudo dpkg --install icaclient_13.10.0.20_amd64.deb
bindsym $mod+Shift+e exec i3-msg exit
#!/bin/sh
xrandr --output $1
xrandr --output $2 --auto --right-of $1
xrandr --output $3 --auto --right-of $2
xrandr | grep " connected" | awk '{print $1}'
./monitor.sh "DP-4" "DP-1-3" "eDP-1-1"
or just install 'arandr' and generate bash script
sudo apt install arandr
apt-get install xdotool
# move the mouse x y
xdotool mousemove 1800 500
# left click
xdotool click 1
sudo apt-get install keynav
killall keynav
cp /usr/share/doc/keynav/keynavrc ~/.keynavrc
keynav ~/.keynavrc
example of custom configfile
clear
daemonize
Super+j start,cursorzoom 400 400
Escape end
shift+j cut-left
shift+k cut-down
shift+i cut-up
shift+l cut-right
j move-left
k move-down
i move-up
l move-right
space warp,click 1,end
Return warp,click 1,end
1 click 1
2 click 2
3 click 3
w windowzoom
c cursorzoom 400 400
a history-back
Left move-left 10
Down move-down 10
Up move-up 10
Right move-right 10
gcal --with-week-number
- vnc alternative - connect to existing session
- web page like a screensaver
- jira editing shortcuts
- i3 window manager shortcuts
- xmind settings
XMind.ini:
-vm /home/user/.sdkman/candidates/java/8.0.222-zulu/bin/java
echo $XDG_CONFIG_DIRS
locate rc.lua
# place for mouse pointer, cursor, theme
/usr/share/icons
# retrieve all html anchors from url, html tags from url
curl -X GET https://www.bluejeans.com/downloads | grep -o '<a .*href=.*>' | sed -e 's/<a /\n<a /g' | sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' | grep rp
sudo alien --to-deb bluejeans-1.37.22.x86_64.rpm
sudo dpkg -i bluejeans_1.37.22-2_amd64.deb
sudo apt install libgconf-2-4
sudo ln -s /lib/x86_64-linux-gnu/libudev.so.1 /lib/x86_64-linux-gnu/libudev.so.0
sudo ln -s /opt/bluejeans/bluejeans-bin /usr/bin/bluejeans
smbclient -U $SAMBA_CLIENT_GROUP//$SAMBA_CLIENT_USER \
//europe.ubs.corp/win_drive/xchange/Zurich/some/folder
- https://askubuntu.com/questions/700015/set-path-for-terminator-to-lookup-for-plugins
- https://github.com/gstavrinos/terminator-jump-up
- https://github.com/mikeadkison/terminator-google/blob/master/google.py
echo "hello vim " | vim - -c "set number"
- v - visual selection ( start selection )
- y - yank ( end selection )
- p - paste into position
- u - undo last changes
- ctrl-r - redo last changes
:read !ls -la
1) select text with v-visual mode
2) semicolon
3) w !sh
:'<,'>w !sh
file .vimrc
should have next content:
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
call plug#end()
set laststatus=1
git clone https://github.com/vim-airline/vim-airline ~/.vim/plugged/vim-airline
.vim
├── autoload
│ └── plug.vim
├── colors
│ └── wombat.vim
├── pack
│ └── plugins
└── plugged
├── goyo.vim
├── lightline.vim
├── limelight.vim
├── seoul256.vim
├── vim-airline
└── vim-airline-themes
task add what I need to do
task add wait:2min finish call
task waiting
task 25 modify wait:2min
task 25 edit
task 25 delete
task 25 done
task project:'BMW'
task priority:high
task next
doc:
extension:
- https://github.com/ValiValpas/taskopen installation issue:
sudo cpan JSON
commands:
task 13 annotate -- ~/checklist.txt
task 13 annotate https://translate.google.com
task 13 denotate
taskopen 1
# add notes
task 1 annotate Notes
taskopen 1
copy to ~/.config/vifm/colors
color scheme
:colorscheme <tab>
vscjava.vscode-java-debug
peterjausovec.vscode-docker
ryu1kn.edit-with-shell
inu1255.easy-shell
tyriar.terminal-tabs
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
redhat.java
yzhang.markdown-all-in-one
vscjava.vscode-maven
ms-python.python
liximomo.remotefs
scala-lang.scala
visualstudioexptteam.vscodeintellicode
miguel-savignano.terminal-runner
- web-based terminal, terminal window in browser
- automation for browsers, automate repited actions: iMacros
- md2html, markdown to html
sudo apt-get update
sudo apt-get install -y python3-sphinx
pip3 install recommonmark sphinx-markdown-tables --user
sphinx-build "/path/to/source" "/path/to/build" .
- keepass
sudo add-apt-repository ppa:jtaylor/keepass
sudo apt-get update && sudo apt-get install keepass2
- vnc
- vnc installation
sudo apt install xfce4
sudo apt install tightvncserver
# only for specific purposes
sudo apt install x11vnc
- ~/.vnc/xstartup, file for starting vncserver chmod +x ~/.vnc/xstartup
#!/bin/sh
# Fix to make GNOME and GTK stuff work
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
- vnc commands
# start server
vncserver -geometry 1920x1080
# full command, $DISPLAY can be ommited in favoud to use "next free screen"
vncserver $DISPLAY -rfbport 5903 -desktop X -auth /home/qqtavt1/.Xauthority -geometry 1920x1080 -depth 24 -rfbwait 120000 -rfbauth /home/qqtavt1/.vnc/passwd -fp /usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1 -co /etc/X11/rgb
## Couldn't start Xtightvnc; trying default font path.
## Please set correct fontPath in the vncserver script.
## Couldn't start Xtightvnc process.
# start server with new monitor
vncserver -geometry 1920x1080 -fp "/usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins"
# check started
ps aux | grep vnc
# kill server
vncserver -kill :1
- vnc start, x11vnc start, connect to existing display, vnc for existing display
#export DISPLAY=:0
#Xvfb $DISPLAY -screen 0 1920x1080x16 &
#Xvfb $DISPLAY -screen 0 1920x1080x24 # not more that 24 bit for color
#startxfce4 --display=$DISPLAY &
# sleep 1
x11vnc -quiet -localhost -viewonly -nopw -bg -noxdamage -display $DISPLAY &
# just show current desktop
x11vnc
- vnc client, vnc viewer, vnc player
# !!! don't use Remmina !!!
sudo apt install xvnc4viewer
- timer, terminal timer, console timer
sudo apt install sox libsox-fmt-mp3
https://github.com/rlue/timer
sudo curl -o /usr/bin/timer https://raw.githubusercontent.com/rlue/timer/master/bin/timer
sudo chmod +x /usr/bin/timer
# set timer for 5 min
timer 5
raise InitError("Failed to unlock the collection!")
# kill all "keyring-daemon" sessions
# clean up all previous runs
rm ~/.local/share/keyrings/*
ls -la ~/.local/share/keyrings/
dbus-run-session -- bash
gnome-keyring-daemon --unlock
# type your password, <enter> <Ctrl-D>
keyring set cc.user cherkavi
keyring get cc.user cherkavi
Generating a RSA private key
openssl req -new -newkey rsa:2048 \
-nodes -out cherkavideveloper.csr \
-keyout cherkavideveloper.key \
-subj "/C=DE/ST=Bavaria/L=München/O=cherkavi/CN=cherkavi developer" \
video camera, camera settings, webcam setup
# camera utils installation
sudo apt install v4l-utils
sudo apt install qv4l2
# list of devices
v4l2-ctl --list-devices
# list of settings
v4l2-ctl -d /dev/video0 --list-ctrls
camera settings example
# /etc/udev/rules.d/99-logitech-default-zoom.rules
SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTRS{product}=="HD Pro Webcam C920", ATTRS{serial}=="BBBBFFFF", RUN="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=zoom_absolute=170"