start new:
tmux
start new with session name:
tmux new -s myname
# inside your .bashrc or .zshrc (on the server side) add: | |
# start tmux if we ssh into the box | |
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then | |
tmux attach-session -t $USER || tmux new-session -s $USER | |
fi | |
# this will attach to an ongoing tmux session or start a new one | |
# the session name will be the name of the user ($USER) |
# _oo0oo_ | |
# o8888888o | |
# 88" . "88 | |
# (| -_- |) | |
# 0\ = /0 | |
# ___/`---'\___ | |
# .' \| |// '. | |
# / \||| : |||// \ | |
# / _||||| -:- |||||- \ | |
# | | \\ - /// | | |
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
hanoi :: Int -> [(Int,Int)] | |
hanoi n = hanoi' n 1 2 3 | |
hanoi' 0 _ _ _ [] | |
hanoi' n src temp dest = top_to_temp ++ botton_to_dest : top_to_dest | |
where top_to_temp = hanoi' (n-1) src dest temp | |
bottom_to_dest = (src, dest) | |
tops_to_dest = (hanoi' (n-1) temp src dest) |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
if [[ ! -n $REIMPORTDB_PATH ]]; then | |
export REIMPORTDB_PATH=/usr/local/bin/ | |
fi | |
${REIMPORTDB_PATH}dropdb --if-exists {DB_NAME} | |
${REIMPORTDB_PATH}createdb -U{DB_USER} -O{DB_USER} {DB_NAME} | |
${REIMPORTDB_PATH}psql -U{DB_USER} {DB_NAME} < database/schema_postgres.sql |
fetch("https://api-customer.thaichana.com/shop/search", { | |
"headers": { | |
"accept": "application/json, text/plain, */*", | |
"accept-language": "en-US,en;q=0.9,th;q=0.8,fr;q=0.7", | |
"content-type": "application/json;charset=UTF-8", | |
"sec-fetch-dest": "empty", | |
"sec-fetch-mode": "cors", | |
"sec-fetch-site": "same-site" | |
}, | |
"referrer": "https://merchant.thaichana.com/search?size=10&page=0&category=%E0%B8%97%E0%B8%B8%E0%B8%81%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B9%80%E0%B8%A0%E0%B8%97&province=%E0%B8%81%E0%B8%A3%E0%B8%B8%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%9E%E0%B8%A1%E0%B8%AB%E0%B8%B2%E0%B8%99%E0%B8%84%E0%B8%A3&rating=0&passQuestionnaire=false&lockLatLong=false", |
Whoo! This was a fun challenge with loads to learn. :)
The given code level11.c
checks whether the two inputs (as argv[1]
and argv[2]
) both MD5 hash to the same value or not. If they do, it uses both inputs as brainfuck code, and executes them. Then it checks if the outputs differ. Upon differing outputs, they are checked against the strings "io.sts Rules!"
and "io.sts Sucks!"
. If prog1's output is the first, and prog2's output is the second, we are granted shell.
FROM centos:5 | |
RUN yum -y install ld-linux.so.2 | |
ADD ./j2sdk-1_4_2_19-linux-i586-rpm.bin / | |
RUN chmod +x /j2sdk-1_4_2_19-linux-i586-rpm.bin | |
RUN (echo yes) | sh /j2sdk-1_4_2_19-linux-i586-rpm.bin | |
RUN rpm -Uvh /j2sdk-1_4_2_19-linux-i586.rpm | |
ENV JAVA_HOME /usr/java/j2sdk1.4.2_19 |