start new:
tmux
start new with session name:
tmux new -s myname
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
#! /bin/sh | |
set -e | |
# Save the $timeout and $timeout_style values set by /etc/grub.d/00_header | |
# before /etc/grub.d/30_os-prober messes them up. | |
cat << EOF | |
set timeout_bak=\${timeout} | |
set timeout_style_bak=\${timeout_style} | |
EOF |
{ | |
"0": "-----", | |
"1": ".----", | |
"2": "..---", | |
"3": "...--", | |
"4": "....-", | |
"5": ".....", | |
"6": "-....", | |
"7": "--...", | |
"8": "---..", |
This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.
There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.
$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log > requests.txt
import paramiko | |
import time | |
import re | |
bastion_ip='ip' | |
bastion_pass='pass' | |
ssh = paramiko.SSHClient() | |
ssh.set_missing_host_key_policy( paramiko.AutoAddPolicy() ) | |
ssh.connect(bastion_ip, username='root', password=bastion_pass) |
#Rewrites the request, extracting a fragment of the file name and using a remote server. | |
location @fetchFromRemote { | |
rewrite ^/path/to/images/(.*)$ http://remoteserver.com/other/path/to/images/$1 redirect; | |
} | |
#Will try to see if we have the file in this server, is not will use fetchFromRemote | |
location ~ ^/path/to/images/.*(png|jpg|jpeg|gif|ico|swf)$ { | |
try_files $uri @fetchFromRemote; | |
} |
#[link(name = "logger")] | |
extern { | |
fn CrystalLog(text: *const u8); | |
} | |
fn log(text: &'static str) { | |
unsafe{ CrystalLog(text.as_bytes().as_ptr()) }; | |
} | |
fn main() { |