Skip to content

Instantly share code, notes, and snippets.

@mouuff
mouuff / grub2.cfg
Created June 24, 2012 09:33
grub2 configuration
[mou@mou ~]$ sudo cat /etc/grub2.cfg
[sudo] password for mou:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
@mouuff
mouuff / treemap.py
Created June 24, 2012 09:37
tree maper
# -*- coding: utf-8 -*-
#not fully working atm
import os
import os.path
import math
import sys
def dir_size(dir):
total = 0
for dirpath, dirnames, filenames in os.walk(dir):
@mouuff
mouuff / pyget.py
Created June 26, 2012 07:40
a python web downloader with statut
from urllib import urlretrieve
from sys import stdout, argv
from time import time
from os import getcwd, path
import hashlib
class download:
def __init__(self, link, file_name='', checksum='md5'):
self.checksum = checksum.lower()
@mouuff
mouuff / gtranslate.py
Created August 21, 2012 09:33
android fast translator
#!/usr/bin/env python
# -*- coding: latin-1 -*-
import android
import urllib2
droid = android.Android()
def translate(to_translate, to_langage="auto", langage="auto"):
'''Return the translation using google translate
@mouuff
mouuff / sensors.py
Created August 29, 2012 09:23
Learning android api: sensors
import android
import time
droid = android.Android()
def readaccelerometer(read_time=1):
droid.startSensing(2)
time.sleep(read_time)
value = droid.sensorsReadAccelerometer().result
droid.stopSensing()
@mouuff
mouuff / battery infos.py
Created August 29, 2012 16:00
learning android api : battery
import android
import time
droid = android.Android()
def main():
droid.batteryStartMonitoring()
droid.dialogCreateSpinnerProgress("Loading...", "Refreshing informations", 100)
droid.dialogShow()
@mouuff
mouuff / uimd5sum.pyw
Created November 4, 2012 19:32
Script to check the hash of a file
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
#you must have python2.7 and wxPython
import wx
import sys
import hashlib
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
kwds["style"] = wx.DEFAULT_FRAME_STYLE
import android,time
droid = android.Android()
def getPos(waitTime=15):
droid.startLocating()
time.sleep(waitTime)
loc = droid.readLocation().result
@mouuff
mouuff / 8.ino
Created March 12, 2015 07:57
8.ino
#include <WiFi.h>
#include <WiFiUdp.h>
#include <Servo.h>
#include <String.h>
char ssid[] = "android";
char pass[] = "android42";
int status = WL_IDLE_STATUS;
int localPort = 12345;
@mouuff
mouuff / gist:cce41ce8d700a7ba3069
Created April 5, 2015 08:27
Starmade jump drive.au3
#include <MsgBoxConstants.au3>
Global $cd = Int(InputBox ( "Starmade auto pilot", "enter cooldown of your jump drive (in sec)"))*1100
Global $totravel = Int(InputBox ( "Starmade auto pilot", "enter length of your jump (km)"))
MsgBox($MB_SYSTEMMODAL,"How to run?","to launch the script come back in starmade and select jump drive system in your ship, and press TAB and wait :), press ESC to exit script")
Global $running = False
Global $travelled = 0;
HotKeySet( "{TAB}", "_Loop")