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 | |
ssh -l root "$1" awk -F: "'\$2 ~ /^[^!*]/ {print \$1}'" /etc/shadow | |
for f in `ssh -l root "$1" cat /etc/passwd | cut -d ':' -f 1,6`;do | |
if ssh -l root "$1" [ -e "${f#*:}/.ssh/authorized_keys" ];then | |
echo "${f%:*}" | |
fi | |
done |
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
[print({0:'FizzBuzz',32:'Fizz',16:'Buzz'}.get(0-n%3&16|0-n%5&32,n)) for n in range(1,101)] | |
# | |
# 0001 | |
# 1111 | |
# 1100 & 1000 = 1000 | |
# | |
# 1 & 1 = 1 | |
# 1 & 0 = 0 | |
# 0 & 0 = 0 |
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
date -d "`grep -oE '[0-9A-F][0-9A-F]( [0-9A-F][0-9A-F]){10}' | sed -e 's/^/16i /' -e 's#$# Ai r 100* + sZ a sz Zd!=z ss 9 ss sM sh sd sm r 256* + sY [0]sN [[]]sB lZ 1000lZ<N 999lZ>B lz[ ] ls 10ls<N 9ls>B [:] lM 10lM<N 9lM>B [:] lh 10lh<N 9lh>B [ ] ld 10ld<N 9ld>B [/] lm 10lm<N 9lm>B [/] lY nnnnnnnnnnnnnnnnnnnn 10an f#'|dc`" "$@" |
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
#include <stdio.h> | |
int main() { | |
for (int i=1;;i++) printf("FizzBuzz\n\0 Buzz\n\0 Fizz\n\0 %d\n"+(0-i%3&16|0-i%5&32),i); | |
} |
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
import string as Q,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re ,re | |
T = Q.maketrans( '0123456789.?)}]>#:,!({[<@;' ,'9876543210,!({[<@;.?)}]>#:' ) | |
R ,_ ,_ ,_ ,_ ,_= re.compile ( '^(([a-zA-Z]+)|([0-9]+|.))(.*)$') ,1 ,1 ,1 ,1 ,1 | |
def twist ( S ,r = ('' ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1)[ 0 ]): | |
S ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ =' '.join ( S.split()) ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 | |
while S and ( 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ) : | |
m ,_,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,_ ,Y= R.match(S),1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 | |
r +=(( (m.group ( 2 )or'' ).swapcase()[ : :-1 ]+ ( m.group ( 3 ) or'' ) ) )\ | |
.translate ( * ( T ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1)[0:1] ) | |
S=m.group ( (4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ,4 ) [ 0 ]) |
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
[Zd!=z]sz # delete top of stack | |
# perform a loop over all numbers running b | |
[lbx1+lax]sa # loop forever running b each time | |
[lpx]sb # logic goes here | |
1 | |
lax |
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
You have a VPN to work. | |
You have a gateway host you're required to ssh through. | |
You have a mac. | |
You want SSHing to be fast, if possible. | |
10.0.0.10 is a fill in for the bastion host. | |
My name is James. Your name probably isn't. | |
10.11.12.13 is a fill in for my desktop. | |
If you're not connected to the VPN, it will just try and connect directly. |
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
# awk field separator for a slightly customized apache access log (the :443 is the custom part) | |
awk -F ':443 |" |[][]| - - | [0-9][0-9]* "-"' | |
# For your average apache log with square brackets around the date, this will give you the log | |
# entries for the seconds around the entries you pipe into awk at the beginning | |
# replace BADNESS_HERE with whatever you want to find seconds around. | |
# | |
# NOTE: this can also be used to find things that happened within the seconds around 5 minutes | |
# before the event by changing s/$/p1-p2+p/ to s/$/300-p1-p2+p/ and other interesting |
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 | |
# A split window generator for tmux. | |
# Copyright 2014, James Andariese | |
# For what it's worth. | |
# MIT license. | |
# If things go wrong, it tends to leave either a single or many windows open with your local shell. | |
# I don't fix that because I don't care even a little bit. | |
# Don't do things wrong and be prepared to hit control D if you do. The cost of fixing is greater. |
NewerOlder