Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Working from home forevah!

Mark Sta Ana booyaa

🏠
Working from home forevah!
View GitHub Profile
@md5
md5 / 00_README.md
Last active May 11, 2025 13:13
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
@segrax
segrax / CreateFreeBSDVm.sh
Last active September 8, 2020 16:05
Create a FreeBSD 64bit VM with VirtualBox, on FreeBSD, Accepting VNC Connections
# Create a VM named 'MyBSDBox' (64 bit FreeBSD)
VBoxManage createvm --ostype FreeBSD_64 --register --basefolder /vms --name MyBSDBox
# 1gig of memory, 1 CPU.. and set the network to bridged via EM0, emulating the 82540EM chipset
VBoxManage modifyvm MyBSDBox --memory 1024 --ioapic on --cpus 1 --chipset ich9 --nic1 bridged --nictype1 82540EM --bridgeadapter1 em0
# 20 gig Dynamic HDD image, on sata controller
VBoxManage createhd --size 20000 --filename "/vms/MyBSDBox/MyBSDBox.vdi"
VBoxManage storagectl MyBSDBox --name "SATA Controller" --add sata --controller IntelAhci --portcount 4
VBoxManage storageattach MyBSDBox --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "/vms/MyBSDBox/MyBSDBox.vdi"
@mattjmorrison
mattjmorrison / chess_clock.sh
Created October 3, 2014 02:44
Tmux Chess Clock Pairing
#!/bin/bash
`tmux set-option -g display-time 2000`
IFS=$'\n'
CLIENTS=()
for CLIENT in $(tmux list-clients); do
CLIENTID="${CLIENT%:*}"
if [[ $CLIENT == *\(ro\) ]]
then
@ismasan
ismasan / sse.go
Last active February 27, 2025 00:15
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@torumakabe
torumakabe / hpcos_vboxsetup_controller.sh
Created January 4, 2014 13:28
Creare VirtualBox VM for HP Cloud OS Sandbox 1.20 controller node
#!/bin/sh
VBoxManage createvm --name "controller" --ostype Ubuntu_64 --register
VBoxManage modifyvm "controller" --cpus 1
VBoxManage modifyvm "controller" --memory 4096
VBoxManage modifyvm "controller" --nic1 hostonly
VBoxManage modifyvm "controller" --hostonlyadapter1 vboxnet0
VBoxManage modifyvm "controller" --nictype1 Am79C973
VBoxManage modifyvm "controller" --nicpromisc1 allow-all
VBoxManage modifyvm "controller" --nic2 intnet
@ghoulmann
ghoulmann / SteamOS_VB.sh
Created December 18, 2013 23:06
Downloads SteamOS.zip, creates ISO, installs virtualbox 4.2 & dkms, and creates virtual machine for user with boot ISO attached and EFI enabled. Requires: Ubuntu, internet, sudo access...
#!/bin/bash -e
#Set up customizeable variables
VM='SteamOS' #the name of the vm
TRASH="/tmp" #where to dump the zip and decompressed folder
ISO="steamos-1.0-uefi-amd64.iso" #what to call the iso
PUT="/tmp" #where to put the iso
VDI=$(pwd) #where to put the virtual drive
@SteveSwink
SteveSwink / CaptureScreenshot.cs
Created August 14, 2013 20:15
Screenshot grabber for unity
using UnityEngine;
using System.Collections;
using System.IO;
public class CaptureScreenshot : MonoBehaviour {
public int sizeMultiplier = 2;
public string prefix = "Scale_Screen";
int incrementValue = 0;
@willurd
willurd / web-servers.md
Last active May 14, 2025 19:48
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@trastle
trastle / timestamp.js
Created April 19, 2013 09:34
Timestamp in JS (yuk)
function timeStamp() {
var d = new Date();
var hour = ('0' + d.getHours()).slice(-2);
var min = ('0' + d.getMinutes()).slice(-2);
var sec = ('0' + d.getSeconds()).slice(-2);
var mil = ('000' + d.getMilliseconds()).slice(-3);
return hour + ":" + min + ":" + sec + "(" + mil + ")";
}
@VRMink
VRMink / gist:5169211
Last active January 6, 2020 20:31
How to setup a private node.js web server with SSL authorization

Secure private web server with NodeJS

This article will explain how to set up a secure web server with NodeJS which only accepts connection from users with SSL certificates that you have signed. This is an efficient way to ensure that no other people are able to access the web server, without building a login system which will be significantly weaker.

I will not explain how to create a certificate authority (CA), create certificates or sign them. If you need to read up on this, have a look at this excelent article on how to do it with OpenSSL (Mac and Linux): https://help.ubuntu.com/community/OpenSSL#Practical_OpenSSL_Usage It is also possible to do this on a Mac with the keychain application, and I assume it is possible on a Windows machine aswell.

This architecture will allow you to have one web server communicating with an array of trusted clients, the web server itself can be on the public internet, that will not decrease the level of security, but it will only ser