Skip to content

Instantly share code, notes, and snippets.

View saltukalakus's full-sized avatar
💭

Saltuk Alakus saltukalakus

💭
View GitHub Profile
@sasha-id
sasha-id / README
Created March 23, 2012 15:03
MongoDB multiple instance upstart scripts: mongodb, mongod --configsvr and mongos
MongoDB upstart scripts for Ubuntu.
Run following commands after installing upstart scripts:
ln -s /lib/init/upstart-job /etc/init.d/mongoconf
ln -s /lib/init/upstart-job /etc/init.d/mongodb
ln -s /lib/init/upstart-job /etc/init.d/mongos
To start services use:
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@wolfg1969
wolfg1969 / README.md
Last active December 15, 2023 08:06
python-gps sample codes, Raspberry Pi 4 + u-blox GPS module (uart)

Raspberry Pi 4 + u-blox GPS module (uart)

$ sudo apt-get update
$ sudo apt-get install gpsd gpsd-client python-gps

Enable the serial interface and disable serial login shell with raspi-config then reboot. Confirm /dev/ttyS0 exists

$ ls -l /dev/serial*
lrwxrwxrwx 1 root root 5 May 9 10:38 /dev/serial0 -> ttyS0
@wacko
wacko / gist:5577187
Last active January 6, 2024 07:31
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 2 > host-only vboxnet0

@geoff-parsons
geoff-parsons / live-update-chartjs.html
Created June 1, 2013 05:36
Example of live updating Chart.js charts.
<!DOCTYPE html>
<html>
<head>
<title>Chart.js Redraw Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="chart.min.js"></script>
<script type="text/javascript" charset="utf-8">
window.chartOptions = {
segmentShowStroke: false,
@serverwentdown
serverwentdown / server.js
Last active January 29, 2019 20:18 — forked from mixonic/server.js
// Bug fixes for current versions.
//
// This server will start a bash shell and expose it
// over socket.io to a browser. See ./term.html for the
// client side.
//
// You should probably:
//
// npm install socket.io
@jfromaniello
jfromaniello / gist:8418116
Last active September 19, 2023 23:38
Example of authenticating websockets with JWTs.
var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({port: 8080});
var jwt = require('jsonwebtoken');
/**
The way I like to work with 'ws' is to convert everything to an event if possible.
**/
function toEvent (message) {
try {
@gfrey
gfrey / gist:8472007
Created January 17, 2014 11:34
Upstart script for haproxy with support for reload.
description "Properly handle haproxy"
start on startup
env PID_PATH=/var/run/haproxy.pid
env BIN_PATH=/usr/sbin/haproxy
script
exec /bin/bash <<EOF
$BIN_PATH -f /etc/haproxy.cfg -D -p $PID_PATH
# HAProxy config for hoodie + ssl.
# Uses nginx for file serving on 127.0.0.1:5999
# This is optional, Hoodie can serve static files fine.
global
log 127.0.0.1 local0 debug
maxconn 4096
user haproxy
group haproxy
daemon
@rdegges
rdegges / quickstart.js
Last active August 29, 2015 14:01
Stormpath Node.js Quickstart
/*
* quickstart.js
* ~~~~~~~~~~~~~
*
* Code from the Stormpath Node.js Quickstart:
* http://docs.stormpath.com/nodejs/quickstart/
*
* You can run this code by typing:
*
* $ node quickstart.js