Skip to content

Instantly share code, notes, and snippets.

View teknoraver's full-sized avatar
🖥️
coding

Matteo Croce teknoraver

🖥️
coding
View GitHub Profile
#!/usr/bin/python
from scapy.all import *
mgmt = "\x89D!!\0\0\0\0d\0\x01\x04\0\x01x\x01\x08\x82\x84\x8b\x96\x0c\x12\x18$\x03\x01\x01\x05\x04\x01\x02\0\02\x040H`l"
beacon = RadioTap()/Dot11()/Dot11Beacon(mgmt)
beacon.payload.addr1 = "ff:ff:ff:ff:ff:ff"
# read a file with words to use as ESSID
dict = open("/usr/share/dict/italian", "r")
#!/usr/bin/perl -w
my $lastquot = '';
while(<>) {
$quot = /<(.*)> (.*)/;
$quot = $1;
$line = $2;
if($lastquot ne $quot) {
print "»\n" if($lastquot);
print "$quot: «";
#!/bin/sh
archs='i386 i486 i586 pentium pentium-mmx pentiumpro i686 pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 nehalem westmere sandybridge ivybridge haswell broadwell bonnell silvermont knl k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 btver1 btver2 winchip-c6 winchip2 c3 c3-2 geode'
dryes() {
local sum=0 res=0
for i in $(seq 1 $1); do
res=$(./dry 2>/dev/null |awk '/^Dhrystones/{print$4}')
sum=$((sum + res))
done
--- a/src/progress.c
+++ b/src/progress.c
@@ -929,7 +929,7 @@ create_image (struct bar_progress *bp, d
*/
#define PROGRESS_FILENAME_LEN MAX_FILENAME_COLS + 1
-#define PROGRESS_PERCENT_LEN 4
+#define PROGRESS_PERCENT_LEN 5
#define PROGRESS_DECORAT_LEN 2
#define PROGRESS_FILESIZE_LEN 7 + 1
#!/bin/bash
for l in {A..Z}; do
i=1
f=
while curl -sf http://santiebeati.it/$l/$f; do
i=$((i + 1))
f=more$i.html
done
done |awk -F'<|>' '/<FONT SIZE="-2" COLOR="#FFFFFF">/{print$7$9$11}'
#include <stdio.h>
#include <errno.h>
#include <qrencode.h>
/* gcc -O2 qrc.c -o qrc -lqrencode */
int main(int argc, char *argv[])
{
int i, j;
if(argc < 2)
return 0;
#!/bin/sh
[ -d "$1/.git" ] || exec echo "$1 is not a git repository"
cp -r $1/.git .
git checkout AndroidManifest.xml && git mv -f AndroidManifest.xml app/src/main/
git checkout res && {
rm -rf app/src/main/res/
git mv res app/src/main/
}
#!/bin/sh
rulefile=/etc/udev/rules.d/51-android.rules
url=http://developer.android.com/tools/device.html
rule='/<td><code>....<\/code><\/td>/{print "SUBSYSTEM==\"usb\", ATTR{idVendor}==\""$5"\", MODE=\"0660\", GROUP=\"plugdev\""}'
curl -s $url | awk -F'<|>' "$rule" >$rulefile
chmod 755 $rulefile
#!/bin/sh
[ $# -eq 2 ] || exec echo "Usage: $0 <install.iso> <disk.img>"
root=/tmp/${0##*/}.$$
mkdir $root
sudo mount -r -oloop "$1" $root
kvm -m 512 -no-reboot -nographic -boot d -cdrom "$1" -drive "file=$2,index=0,media=disk,format=raw" -kernel $root/install.*/vmlinuz -initrd $root/install.*/initrd.gz -append console=ttyS0,115200
sudo umount $root
rmdir $root
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#define BLOCK 65536
/*