This file contains 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
from selenium import webdriver | |
import sys | |
url_input = ("file://" if not sys.argv[1].startswith("http") else "") + sys.argv[1] | |
image_output = sys.argv[2] | |
driver = webdriver.Chrome() # or PhantomJS() not to open a windows (require phantomjs) | |
driver.get(url_input) | |
if driver.save_screenshot(image_output): | |
print("Save ok !") |
This file contains 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/zsh | |
#require zsh and colordiff (credits: https://superuser.com/questions/125376/how-do-i-compare-binary-files-in-linux) | |
diff -y <(xxd $1) <(xxd $2) | colordiff |
This file contains 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
from fpdf import FPDF | |
from path import Path | |
import sys | |
imagelist = [x for x in sorted(Path(sys.argv[1]).listdir()) if x.ext == ".jpg"] | |
pdf = FPDF() | |
for im in imagelist: | |
pdf.add_page(orientation="P", format=(410,550)) #Size of images is known |
This file contains 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
#define _GNU_SOURCE | |
#include <unistd.h> | |
#include <dlfcn.h> | |
#include <sys/mman.h> | |
#include <link.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void *begin; |
This file contains 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
#define _GNU_SOURCE | |
#include <unistd.h> | |
#include <dlfcn.h> | |
#include <sys/mman.h> | |
#include <link.h> | |
#include <errno.h> | |
/* | |
- info: pointer to a dl_phdr_info { | |
ElfW(Addr) dlpi_addr; // Base address of object |
This file contains 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/bash | |
#Do all the partition stuff | |
#Let's consider we install to sda1 | |
mkdir /media/debian | |
mount /dev/sda1 /media/debian |
This file contains 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/bash | |
sed -i 's,^\(NETDOWN=\).*,\1'no',' /etc/init.d/halt | |
aptitude install ethtool -y | |
echo 'pre-down /usr/sbin/ethool -s eth0 wol g' >> /etc/network/interface |
This file contains 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 <iostream> | |
using namespace std; | |
int main(int argc,char* argv[]) | |
{ | |
unsigned int cpeinfo; | |
unsigned int cpsse3; | |
__asm__( | |
"mov $01,%%eax;" |
This file contains 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 <iostream> | |
int main(void) | |
{ | |
unsigned long long var_RFLAGS = 0; | |
__asm__ ( | |
"pushfq;" // Put RFLAGS into stack | |
"pop %%rax;" // Pop them in rax | |
"mov %%rax, %0" : :"m" (var_RFLAGS) // Retrieve them in a variable |
This file contains 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
; From: http://blog.stalkr.net/2014/10/tiny-elf-3264-with-nasm.html | |
; nasm -f bin -o tiny32 tiny32.asm | |
BITS 32 | |
org 0x08048000 | |
ehdr: ; Elf32_Ehdr | |
db 0x7F, "ELF", 1, 1, 1, 0 ; e_ident | |
times 8 db 0 | |
dw 2 ; e_type | |
dw 3 ; e_machine |