Skip to content

Instantly share code, notes, and snippets.

View samuelgrigolato's full-sized avatar

Samuel Grigolato samuelgrigolato

View GitHub Profile
@htruong
htruong / chroot-to-pi.sh
Last active May 5, 2024 10:59
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@tomconte
tomconte / web3-solc-contract-compile-deploy.js
Created December 13, 2016 09:32
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@alexandre
alexandre / word_counter.py
Last active August 29, 2015 14:08
word counter
from itertools import groupby
def word_counter(*words):
'''Write a Python program that inputs a list of words, separated by white-
space, and outputs how many times each word appears in the list.
'''
return {word: len(list(word_group)) for word, word_group in
groupby(sorted(words), key=lambda x: x)}
@codeprimate
codeprimate / gist:4390600
Created December 27, 2012 18:22
Example SysV init script for a java application From: http://zerocool.is-a-geek.net/?p=139
#!/bin/sh
### BEGIN INIT INFO
# Provides: vsftpdg
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop vsftpdg server
### END INIT INFO