Skip to content

Instantly share code, notes, and snippets.

Romain Bochet rbochet

  • Lyon
Block or report user

Report or block rbochet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rbochet
rbochet / ssh-copy-id
Created Aug 23, 2011
ssh-copy-id for the operating systems without this command (like Ubuntu). Put it in the path and use it with 'ssh-copy-id romain@192.168.1.34'
View ssh-copy-id
cat ~/.ssh/*.pub | ssh $1 'mkdir -p .ssh; chmod 700 .ssh; cat>>.ssh/authorized_keys'
@rbochet
rbochet / UnixPipeActivity.java
Created May 18, 2011
How to write in pipes for Android
View UnixPipeActivity.java
package fr.stackr.android.upt;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
@rbochet
rbochet / Main.java
Created May 11, 2011
This program runs a server that give you the IP address of every client that tries to connect. It works on both side (display the IP and send it back). It is quite useful as a whatismyip service on a local network.
View Main.java
package fr.stackr.java.gimmeyourip;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.WriteAbortedException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
@rbochet
rbochet / Main.java
Created May 11, 2011
This program runs a server that give you the IP address of every client that try to connect. Its quite useful as a whatismyip service on a local network.
View Main.java
package fr.stackr.java.gimmeyourip;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
/**
* This program runs a server that give you the IP address of every client that
* try to connect. Its quite useful as a whatismyip service on a local network.
@rbochet
rbochet / Logcat.cpp
Created May 8, 2011
Option cachée dans Logcat
View Logcat.cpp
case 'Q':
/* this is a *hidden* option used to start a version of logcat */
/* in an emulated device only. it basically looks for androidboot.logcat= */
/* on the kernel command line. If something is found, it extracts a log filter */
/* and uses it to run the program. If nothing is found, the program should */
/* quit immediately */
#define KERNEL_OPTION "androidboot.logcat="
#define CONSOLE_OPTION "androidboot.console="
{
int fd;
@rbochet
rbochet / GoogleChartLoad.sh
Created Apr 3, 2011
Should work on every unix, including OSX (doesn't rely on procfs)
View GoogleChartLoad.sh
max="3";load=$(uptime | cut -d":" -f4 | cut -d" " -f2 | sed s/,/./g);echo "http://chart.apis.google.com/chart?chxr=0,0,"$max"&chxt=y&chs=700x240&cht=gm&chds=0,"$max"&chd=t:"$load"&chl="$load"&chtt=$(hostname | sed s/.local//)+load+average"
@rbochet
rbochet / MapsApiv3.html
Created Mar 27, 2011
Google Maps API v3: LatLngBounds and multiple infoWindows
View MapsApiv3.html
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<title>API Maps v3: Multiple infoWindows and zoom issues</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var sites = [
['Darlington', -35.0252820, 138.5630230, 1, 'Darlington, where I am living.<br/><a href="http://www.flickr.com/photos/rbochet/5560158585/" title="Figue agressive de Romain Bochet, sur Flickr"><img src="http://farm6.static.flickr.com/5030/5560158585_c9a6919140_m.jpg" width="240" height="160" alt="Figue agressive" /></a><br/>See my <a href="http://www.flickr.com/photos/rbochet/sets/72157625988396879/">Flickr album</a>'],
@rbochet
rbochet / RunAsRoot.java
Created Mar 18, 2011
How to ask for root privileges.
View RunAsRoot.java
Process root = Runtime.getRuntime().exec("su");
@rbochet
rbochet / .gitignore
Created Mar 16, 2011 — forked from kogakure/.gitignore
.gitignore file for LaTeX projects on Mac
View .gitignore
# Latex files
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
@rbochet
rbochet / strings.xml
Created Mar 9, 2011
Wikitionnary base
View strings.xml
<string name="template_user_agent">"%s/%s (Linux; Android)"</string>
<string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string>
<string name="template_define_url">"http://en.wiktionary.org/wiki/%s"</string>
You can’t perform that action at this time.