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
liste = "String nomappli,String id2_1,String id3_1,String id4_1,String id2_2,String id3_2,String id4_2, | |
String id5_2,String id6_2,String id7_2,String id8_2,String id9_2,String id2_3,String id3_3,String id4_3,String id2_4, | |
String id3_4,String id4_4,String id2_5, String id3_5,String id4_5,String id5_5,String id6_5,String id7_5" | |
classe = "Application" | |
liste = liste.gsub("\n","") | |
liste = liste.gsub("\r","") | |
liste = liste.gsub(" ","") | |
liste = liste.gsub(" "," ") | |
mon_fichier = File.open("#{classe}.java", "w") |
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
id1 = ["toto","titi"] | |
id2 = ["tt","rr"] | |
liste = ["id1","id2"] | |
for id in liste | |
for value in eval(id) | |
puts value | |
end | |
end |
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
#getting all the variable of a ruby file in a hash | |
result = Hash.new | |
file = File.new("betageneration.rb", "r") | |
while (line = file.gets) | |
if (line=~ / = /) != nil | |
result[line.split(/ = /)[0].to_s] = eval(line.split(/ = /)[1]) | |
end | |
end | |
file.close |
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
// generate code for parsing an array of array | |
tab = [ ["a","b"] , ["c","e"] , ["d"]] | |
def generation(tab) | |
metastring = "" | |
length = tab.length | |
i = 0 | |
indent = " " | |
for content in tab |
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
#Made by the guys at ruby apero | |
#instancing default parameter and passing specific parameter | |
def toto(params={}) | |
p default.merge(params) | |
end | |
def default | |
{:titi => 1, :tata =>2} | |
end |
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
#Class for metaprogramming and network programming with Python 2.x | |
import threading | |
class Graph: | |
def __init__(self,name): | |
self.name = name | |
self.list_neighbor = {} | |
self.list_node = {} | |
def add_node(self,node): | |
self.list_node[node] = True |
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
#save img by gmail | |
import smtplib | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEBase import MIMEBase | |
from email.MIMEText import MIMEText | |
from email import Encoders | |
import os | |
import time | |
import sys | |
import re |
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
#return star trek date time Version for Python 2.x | |
from time import strftime | |
def startrek_time(): | |
t = strftime("%Y%m.%d %H:%M:%S")[2:] | |
if t[0] == "0" : | |
t = strftime("%Y%m.%d %H:%M")[3:] | |
return t |
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
#Return disk space | |
import string | |
import win32api | |
import win32file | |
def PrintSpaceReport(drive): | |
sectorsPerCluster, bytesPerSector, numFreeClusters, totalNumClusters = win32file.GetDiskFreeSpace(drive + ":\\") | |
sectorsPerCluster = long(sectorsPerCluster) | |
bytesPerSector = long(bytesPerSector) | |
numFreeClusters = long(numFreeClusters) |
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
#Show Network Packet | |
from pcapy import * | |
from impacket.ImpactDecoder import EthDecoder | |
class Message(object): | |
def __init__(self, Reseau=None, Masque=None, Type=None,Emetteur=None,Recepteur=None,Taille_Paquet=None,Taille_Total=None,Epoch=None,Ecart=None,Message=None,Proba=None): | |
self.Reseau = Reseau | |
self.Masque = Masque |
OlderNewer