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 | |
lien="$1" | |
dossier="" | |
exclure="$2" | |
wget -nv -nc -nd -X $exclure -r -linf -A zip,rar $lien | |
for file in `ls` do | |
if ( expr "$file" : .*rar$ ) > /dev/null | |
then |
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
#!/usr/bin/env jython | |
#-*- encoding:utf-8 -*- | |
from java.lang import System | |
from javax.swing import JFrame, JButton, JLabel | |
from java.awt import BorderLayout | |
# Exit application | |
def exitApp(event): | |
System.exit(0) |
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
import unittest | |
class Test1 (unittest.TestCase): #Define a class which extend unittest | |
def runTest(self): | |
self.failIf (1+1 != 2, '1+1 failed !') | |
def suite(): | |
suite = unittest.TestSuite() #create an object testsuite | |
suite.addTest(Test1()) | |
return suite |
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
#!/usr/bin/env python | |
#-*- encoding: utf-8 -*- | |
import SocketServer | |
class EchoRequestHandler(SocketServer.BaseRequestHandler): | |
def setup(self): | |
print self.client_address, 'connected!' | |
self.request.send('hi ' + str(self.client_address) + '\n') |
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 | |
ROOT=$1 | |
mount procfs -t proc $ROOT/proc/ | |
mount sysfs -t sysfs | |
mount -o bin /dev $ROOT/dev/ | |
mount -o bin /dev/pts $ROOT/dev/pts | |
mount --bind /etc/resolv.conf $ROOT/etc/resolv.conf | |
chroot $ROOT |
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
#!/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
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> | |
/* | |
- 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
#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 |
OlderNewer