This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[void@stas-console ~]$ cat /tmp/t | |
foo=bar | |
boo=baz | |
zee=roo=zag | |
# this prints changed file but doesn't write changes to file | |
[void@stas-console ~]$ sed -e 's/=/="/' -e 's/$/"/g' -e 's/^/export /g' /tmp/t | |
export foo="bar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[void@stas-console ~]$ VAR='qwe asd erty dfgh vbn' | |
[void@stas-console ~]$ echo $(awk -v var="$VAR" 'BEGIN { count=split(var,fields," "); print fields[count-2] }') | |
erty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install docker-compose | |
mkdir ~/youtube-dl | |
cd ~/youtube-dl | |
cat >docker-compose.yml<<EOF | |
version: '3' | |
services: | |
youtube-dl: | |
build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function openstack-cli() { | |
docker run -it --rm $(env | grep OS_ | sed 's/=.*//;s/^/--env /' | tr '\n' ' ') -v /etc/hosts:/etc/hosts gitlab.int.catalystcloud.nz:4567/catalystcloud/openstack-cli --insecure $@ | |
} | |
source openrc.sh | |
openstack-cli coe cluster config stas-test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# поднимаем сервер | |
# nc -l 9090 & | |
[1] 13126 | |
# ставим дамп | |
# tcpdump -i any port 9090 -A & | |
[2] 13130 | |
# tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | |
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes | |
# клиент посылает данные серверу |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
12 | |
31 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"c1": { | |
"hostname": "netlab-1-0xwl", | |
"interfaces": { | |
"vx1" : { | |
"oip": "192.168.1.2/24", | |
"vid": 1, | |
"remotes": [ | |
"10.240.0.8" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo mdkir /etc/wicd_sdk^C | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo su | |
root@ip-192-168-99-10:/home/ubuntu# mkdir /etc/wicd_sdk | |
root@ip-192-168-99-10:/home/ubuntu# mkdir /etc/wicd_sdk/output | |
root@ip-192-168-99-10:/home/ubuntu# chown ubuntu:ubuntu /etc/wicd_sdk/output | |
root@ip-192-168-99-10:/home/ubuntu# exit | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ touch /etc/wicd_sdk/output/token1 | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ sudo chmod 400 /etc/wicd_sdk | |
(stas-policy)ubuntu@ip-192-168-99-10:~$ touch /etc/wicd_sdk/output/token2 | |
touch: cannot touch '/etc/wicd_sdk/output/token2': Permission denied |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443; | |
server_name localhost; | |
root html; | |
index index.html index.htm; | |
ssl on; | |
ssl_certificate cert.pem; | |
ssl_certificate_key cert.key; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
awk '{ | |
split($0, chars, ""); | |
for (i=1; i<=length($0); i++) { | |
if (flagInLine == 0) { printf ("%-5d", i/32); flagInLine=1 } | |
printf("%s%s ", chars[i], chars[i+1]); | |
if ((i+1) % 32 == 0) { flagInLine=0; printf "\n"} | |
i++ | |
} |
NewerOlder