(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# simple match all query with term facet | |
ejs.Request() | |
.indices("myindex") | |
.types("mytype") | |
.query(ejs.MatchAllQuery()) | |
.facet( | |
ejs.TermsFacet('url') | |
.field('url') | |
.size(20)) |
#!/usr/bin/env ruby | |
# Full Contol on Ethnet, IP & TCP headers. Play with it ;) | |
# to test it: nc -lvp 4444 | |
# as root: tcpdump -nvvvv 'tcp port 4444' -i wlan0 # change wlan0 to your interface | |
# or use packetfu to monitor as tcpdump | |
## cap = PacketFu::Capture.new(:iface => 'wlan0' , :promisc=> true) | |
## cap.show_live(:filter => 'tcp and port 4444') | |
# libpcap should be installed | |
# gem install pcaprub packetfu |
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
package main | |
import ( | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
) | |
const privateKey = `content of id_rsa` |
import sys, os, socket | |
s = socket.socket() | |
s.bind((sys.argv[1], int(sys.argv[2]))) | |
s.listen(5) | |
try: | |
while True: | |
conn, addr = s.accept() | |
path = os.path.join(os.getcwd(), "./"+conn.recv(4096).split("\n")[0].split(" ")[1]) | |
conn.send((open(path).read() if os.path.isfile(path) else reduce(lambda x,s:x+"\n"+s+("/" if os.path.isdir(s) else ""),sorted(os.listdir(path)),"Directory "+path+" ls")) if os.path.exists(path) else '404: '+path) | |
conn.close() |
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
class DictionaryUtility: | |
""" | |
Utility methods for dealing with dictionaries. | |
""" | |
@staticmethod | |
def to_object(item): | |
""" | |
Convert a dictionary to an object (recursive). | |
""" | |
def convert(item): |
/etc/pki/ca-trust/source/anchors
on your CentOS machineupdate-ca-trust extract
wget https://thewebsite.org
/* | |
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command: | |
ssh -R 8080:127.0.0.1:8080 [email protected] | |
which opens a tunnel between the two endpoints and permit to exchange information on this direction: | |
server:8080 -----> client:8080 |
#get a pty through python | |
python -c 'import pty; pty.spawn("/bin/bash");' | |
#grab the user agent from the http header on port 10443 | |
tcpdump -A -l -vvvs 1024 -npi eth0 port 10443 | |
#base64 decode a string | |
echo STRINGTODECODE | base64 --decode | |
#escape jail shell |