Skip to content

Instantly share code, notes, and snippets.

View pedemonte's full-sized avatar

Federico Pedemonte pedemonte

View GitHub Profile
@braindevices
braindevices / #btrfs benchmark for daily used desktop OS
Last active June 29, 2024 06:49
which file sytem to use for daily work? should we turn on btrfs compression?
#btrfs benchmark for daily used desktop OS
@Stadicus
Stadicus / 20-thundroid-welcome
Last active November 21, 2021 12:36
Thundroid: System overview MotD
#!/bin/sh
# by Stadicus
# make executable and copy script to /etc/update-motd.d/
# root must be able to execute bitcoin-cli and lncli
# set colors
color_red='\033[0;31m'
color_green='\033[0;32m'
color_yellow='\033[0;33m'
color_gray='\033[0;37m'
@bhouse
bhouse / centos_nspawn.md
Created February 8, 2016 23:41
Centos 7.2.1511 via systemd-nspawn

Make a directory to install CentOS 7.2.1511 in

[root@localhost ~]# mkdir /centos_chroot

Make a directory for the rpm database

[root@localhost ~]# mkdir -p /centos_chroot/var/lib/rpm

Create the RPM database

@shimondoodkin
shimondoodkin / ThinBTClient.java
Last active September 16, 2022 15:02
android vibrate a vibrating bluetooth bracelet
/*
licence pubilc domain
prepered by Shimon Doodkin
vibrate a vibrating bluetooth bracelet
a simple bt client it sends "RING" AT command to a device named "BRACELET"
it is a good "android bluetooth client example".
@t-oster
t-oster / MakeBraceletRingWithDroidScript
Created February 20, 2015 14:21
This DroidScript (JavaScript for Android) makes my China Bluetooth Bracelet Vibrate whenever I want.
var btn;
var bt;
var txt;
//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a button 1/3 of screen width and 1/4 screen height.
@mstaflex
mstaflex / Tornado webserver MJPEG streamer
Created November 24, 2014 11:23
Python Tornado webserver that streams JPEGs (in img/) as MJPEG-Stream using asynchronous timed callbacks (yields), being able to handly many different streams at the same time
import tornado.ioloop
import tornado.web
import gen
import time
import os
import tornado
file_list = os.listdir("img")
counter = 0
@ToastShaman
ToastShaman / SftpServiceTest.java
Created November 13, 2013 18:40
Using an embedded Apache MINA SSHD server in a unit test to verify that your code is able to upload a file through SFTP. This unit tests uses JSch as the client to speak to an embedded Apache MINA sftp server and verifies that the upload of a text file was successful.
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
@chilicat
chilicat / scp-ssh.gradle
Last active July 10, 2023 02:53
A simple gradle task to upload a file via SCP to a remote host and to execute a command via SSH on a remote host.
repositories { mavenCentral() }
configurations { sshAntTask }
dependencies { sshAntTask 'org.apache.ant:ant-jsch:1.9.2' }
ant.taskdef(
name: 'scp',
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.Scp',
classpath: configurations.sshAntTask.asPath)
@espeed
espeed / HOTAIRBALLOON
Last active September 26, 2023 11:51
This is the first program I ever wrote... It was on the Commodore 64, and it displays a hot air balloon bouncing around the screen in 16 colors. I was probably 7 or 8. This program is the first example in the "C64 Programmers Reference Guide - Chapter 3: Programming Graphics on the Commodore 64" -- http://www.commodore.ca/manuals/c64_programmers…
10 REM SPRITE EXAMPLE 1...
20 REM THE HOT AIR BALLOON
30 VIC=13*4096:REM THIS IS WHERE THE VIC REGISTERS BEGIN
35 POKEVIC+21,1:REM ENABLE SPRITE 0
36 POKEVIC+33,14:REM SET BACKGROUND COLOR TO LIGHT BLUE
37 POKEVIC+23,1:REM EXPAND SPRITE 0 IN Y
38 POKEVIC+29,1:REM EXPAND SPRITE 0 IN X
40 POKE2040,192:REM SET SPRITE 0'S POINTER
180 POKEVIC+0,100:REM SET SPRITE 0'S X POSITION
190 POKEVIC+l, 100:REM SET SPRITE 0'S Y POSITION
@msakamoto-sf
msakamoto-sf / start_jetty.groovy
Last active January 5, 2021 19:54
Jetty + GroovyServlet + Groovy Script = Start Jetty Anywhere !! You only need Groovy :)
@Grapes([
@Grab('org.eclipse.jetty.aggregate:jetty-all:8.1.10.v20130312'),
@Grab('com.h2database:h2:1.3.171'),
@Grab('javax.servlet:servlet-api:2.5'),
])
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import org.eclipse.jetty.webapp.*
import javax.servlet.*
import javax.servlet.http.*