-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.txt
104 lines (97 loc) · 4.66 KB
/
cli.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
== bash
grep '.m3u8\|Manifest' linkslist.txt | cut -c 29- | cut -d"\"" -f1 | grep _07_2015 >> cleanlinklist.txt
#descrp: "takes out the HLS links from a html"
grep -i -o '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}'
# grep con regexp para mails
egrep -e "core id" -e ^physical /proc/cpuinfo|xargs -l2 echo|sort -u
#url: https://access.redhat.com/discussions/480953
#descrp: show how many processors has the server
nproc
#descrp: number of processors
netstat -g
#descrp: show multicast joined groups
openssl x509 -in /home/lucas/teatrix.rocstar.tv/bundle.cer -text -noout | less
#descrp: check certificate data
openssl x509 -in /home/lucas/selfsigned.cer -noout -sha1 -fingerprint
#descrp: check certificate sha1 fingerprint
openssl x509 -in /home/lucas/selfsigned.cer -noout -sha256 -fingerprint
#descrp: check certificate sha256 fingerprint
tar -cO media | openssl aes-256-cbc -a -out backup.enc
# create tar file with all the contents in 'media' folder and encrypts that file with aes-256 (base64 output)
openssl aes-256-cbc -d -in ../backup.enc -a | tar -xf -
# decrypts and untar the file backup.enc
[[ "$(md5sum < elemental_production_server_2.12.0.401325.run)" = "46159302bf9f056aeb5d70f5e2facbfc -" ]] && echo Pass || echo Fail
# check md5sum without hashes file
sudo sysctl -w kernel.sched_rt_runtime_us=1000000
# allow application to utilize up to ~100% of the CPUs assigned to it
systemd-detect-virt
# Detect execution in a virtualized environment
ip maddr show
# show multicast joins
ip addr add 233.54.12.234/32 dev eth1 autojoin
# static multicast join
netstat -g
# show multicast joins
socat - OPENSSL:pop.gmx.net:995
openssl s_client -quiet -connect pop.gmx.net:995
# connect to POP server over TLS
openssl s_client -quiet -connect mail.rocstar.tv:587 -starttls smtp
# connect to smtp server over tls
== wget/curl
wget -m -c --limit-rate=500k ftp://ftp-colsecor:ftpc0ls3c0r@ftp.syt.com/
#descrp: "perform a site mirror, limiting the used bandwith and let you continue the download"
wget http://example.com/images/{1..20}.jpg
#descrp: "Download a list of sequentially numbered files from a server"
curl -v -w "\n time_namelookup: %{time_namelookup}\n time_connect: %{time_connect}\n time_appconnect: %{time_appconnect}\n time_pretransfer: %{time_pretransfer}\n time_redirect: %{time_redirect}\n time_starttransfer: %{time_starttransfer}\n ----------\n time_total: %{time_total}\n" http://la-guia.com.ar/mnp/encuentro/playlist.m3u8
#descrp: make curl show times
== windows
ffmpeg -i http://172.30.153.100/live/telefe/playlist.m3u8 -f rawvideo -y NUL
#descrp:"plays" a hls live or VoD stream saving it to NUL (like linux /dev/null).
netsh interface ip show joins
#descrp: show multicast joins
netsh wlan show profile name="SYT-LAB" key=clear
#descrp: show WLAN profile, and display the passwd in clear
WMIC CPU Get /Format:List
WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors
#descrp: shows how many cores and how many logical processors (HT) has the CPU
echo %NUMBER_OF_PROCESSORS%
#descrp: shows the total logical processors
getlinks.py -u admin -p c0ls3c0r$2014 -f TX_ 172.30.240.1 | findstr /r /c:VOD-mpeg-file/ > teatrix_contents.txt
#descrp: grep like findstr
set PYTHONIOENCODING=UTF-8
#descrp: set python cli encoding
py -3.4 -m venv c:\path\to\wherever\you\want\it
#descrp: create virtualenv with specific version of python
certutil -hashfile Desktop\sandbox.txt MD5
certutil -hashfile Desktop\sandbox.txt SHA1
certutil -hashfile Desktop\sandbox.txt SHA256
# descrp: hash file with MD5, SHA1 or SHA256 hash function
== Powershell
(gci example.txt).LastWriteTime = Get-Date
#descrp: update the "Date modified" parameter of example.txt
foreach ($file in Get-ChildItem) { $file.LastWriteTime = Get-Date }
#descrp: update the "Date modified" for all files in the folder
curl -s -D - http://yahoo.com -o $null
curl -s -D - http://yahoo.com -o /dev/null
#descrp: show only response headers
== Python
pip install --user virtualenvwrapper
#descrp: installs package locally for the user, usually ~/.local
import socket
hostname = socket.gethostbyaddr("8.8.8.8")[0]
print hostname
google-public-dns-a.google.com
import pip; pip.main(['install','unicodecsv'])
#descrp: install package from python shell
== git
git config --global http.sslVerify false
git config http.sslVerify "false"
git archive --remote=<remote> master
#descrp: get the source without including the .git folder
find . -maxdepth 1 -mindepth 1 -type d -exec sh -c '(echo {} && cd {} && git status -s && echo)' \;
#descrp: run git status recursively
== docker
docker rm $(docker ps -a -q)
#descrp: delete all containers
docker rmi $(docker images -a -q)
#descrp: delete all images