Skip to content

Instantly share code, notes, and snippets.

@fervagar
fervagar / unfavorite.js
Created March 4, 2018 17:24 — forked from ashander/unfavorite.js
Delete all your favorites (unfavorite or unlike every tweet) on twitter.com (thx to @JamieMason and @b44rd for inspiring this)
// 1. Go to https://twitter.com/i/likes
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded.
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console)
// Notes: this may take a while if you have a lot of favs/likes
// you can only access your most recent ~2000 likes.
// inspired by https://gist.github.com/JamieMason/7580315
$('.ProfileTweet-actionButtonUndo').click()
@fervagar
fervagar / ask_user_yes_no.c
Created October 20, 2017 18:41
Ask the user for yes/no answer
/*
* Copyright (C) 2017 Fernando Vanyo Garcia
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@fervagar
fervagar / linux.sh
Created January 16, 2017 11:09 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
### Add it to ~/.bashrc ###
## Password generator
genpasswd() {
local len=$1
[ "$len" == "" ] && len=20
pwgen -n -y -s -1 ${len}
}
@fervagar
fervagar / check_ssh_fingerprint.sh
Created April 16, 2016 21:38
Get the SSH server public key fingerprint
#!/bin/bash
if [ $# -lt 1 ]; then
echo "usage: $0 [ssh-keyscan options] host" 1>&2;
exit 1;
fi;
FILE=$(mktemp);
ssh-keyscan $* > $FILE 2> /dev/null;
@fervagar
fervagar / get_shellcode.sh
Last active June 18, 2021 11:42
Bash script that prints out the shellcode of a binary in C string format (using objdump)
#!/bin/bash
## Prints the shellcode in little endian
RAW=$(objdump -d "$1" | grep "^ "|awk -F"[\t]" '{print $2}')
SHELLCODE=""
COUNT=0
for word in $RAW
do
SHELLCODE=${SHELLCODE}${word:6:2}${word:4:2}${word:2:2}${word:0:2}
@fervagar
fervagar / load_animation.sh
Last active March 5, 2016 18:09
Simple bash script that show 'Loading' with moving points
#!/bin/bash
L=`echo $LANG | awk '{split($0,a,"."); print a[1]}'`
case $L in
es_ES)
STRING='Cargando'
LEN=11
;;
*)
STRING='Loading'