Skip to content

Instantly share code, notes, and snippets.

@perusio
perusio / sqlite3.lua
Created February 17, 2012 17:35
Lua SQlite handling via LuaSQL
-- Using LuaSQL for sqlite3 DB handling.
require('luasql.sqlite3')
local env = assert(luasql.sqlite3()) -- create the context
local conn = assert(env:connect("test.sqlite")) -- connect to the DB
-- Do some queries.
assert(conn:execute("CREATE TABLE IF NOT EXISTS tbl1(one varchar(10), two smallint)"))
assert(conn:execute("INSERT INTO tbl1 VALUES('hello!', 10)"))
@jkp
jkp / qt5-base.rb
Created February 26, 2012 22:02
Formula to build a minimal qt5 base installation.
require 'formula'
require 'hardware'
class Qt5Base < Formula
homepage 'http://qt.nokia.com/'
head 'git://gitorious.org/qt/qtbase.git', :tag => 'e34ee3127043773a037bfd18a2d457d409032ee5'
keg_only 'For development purposes only'
def patches
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@tr3buchet
tr3buchet / debootstrap.md
Last active July 5, 2023 11:26
debian usb debootstrap

make sure any needed utilities are installed

sudo aptitude install debootstrap coreutils util-linux e2fsprogs

get usb device

df -h
@heyeshuang
heyeshuang / wrtbwmon
Last active August 19, 2019 03:27
wrtbwmon -- modified for openwrt
#!/bin/sh
#
# Traffic logging tool for OpenWRT-based routers
# Original code at https://code.google.com/p/wrtbwmon/
# For usage with OpenWRT, take a look at http://heyeshuang.tk/?p=268
# Created by Emmanuel Brucy (e.brucy AT qut.edu.au)
# Modified by HeYSH (yeshuanghe AT gmail.com)
#
# Based on work from Fredrik Erlandsson (erlis AT linux.nu)
# Based on traff_graph script by twist - http://wiki.openwrt.org/RrdTrafficWatch
@soarez
soarez / ca.md
Last active July 27, 2025 23:20
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

VPNCMD="sudo /usr/local/vpnserver/vpncmd localhost:443 /SERVER /CMD"
# Create virtual hub
${VPNCMD} HubCreate ${HubName} /PASSWD:admin
# Create local bridge(connect to physical device)
${VPNCMD} BridgeCreate ${HubName} /DEVICE:${phy_dev_name:-eth0}
# Create local bridge(create tap interface)
@allanmc
allanmc / genieacs-install.sh
Last active December 13, 2024 00:42
Install GenieACS on Ubuntu 14.04
#!/bin/sh
set -e
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo add-apt-repository -y ppa:chris-lea/redis-server
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo apt-get -qq update

/etc/config/easycwmp

config local
	option interface wlan0
	option port 7547
	option ubus_socket /var/run/ubus.sock
	option date_format %FT%T%z
	option username bob
@ecliptik
ecliptik / aarch64qemu.md
Last active August 16, 2023 11:03
Ubuntu 14.04 arm64 Port QEMU Configuration

Setting up a Ubuntu 14.04 or Debian 8 (jessie) arm64 VM

This is mainly a notes dump and should be used for reference. This guide assumes:

  • Ubuntu 14.04 (or Debian 8) hypervisor/host with bridge networking
  • Knowledge of qemu
  • Knowledge of debootstrap

Limitations of the qemu-system-aarch64 emulator on x86 include only being able to emulate one CPU and no KVM support.