Skip to content

Instantly share code, notes, and snippets.

View soediro's full-sized avatar

Sudiro soediro

View GitHub Profile
@soediro
soediro / pf.conf
Created November 3, 2017 03:14 — forked from rosstimson/pf.conf
Basic FreeBSD PF firewall for web server - /etc/pf.conf
# vim: set ft=pf
# /etc/pf.conf
ext_if="vtnet0"
webports = "{http, https}"
int_tcp_services = "{domain, ntp, smtp, www, https, ftp}"
int_udp_services = "{domain, ntp}"
set skip on lo
@soediro
soediro / nginx.conf
Created November 3, 2017 05:50 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@soediro
soediro / smartos-on-a-budget.sh
Created November 16, 2017 02:40 — forked from jahewson/smartos-on-a-budget.sh
Installing and Configuring SmartOS on a budget server (with a /29)
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##################################################################
Installing and Configuring SmartOS on a budget server (with a /29)
##################################################################
# if you find this gist useful, please star it
# please be aware that budget hosting companies usually cut corners somewhere,
@soediro
soediro / smart-pub.md
Created November 23, 2017 19:40 — forked from glinton/smart-pub.md
SmartOS zone manipulation. Snapshot, image, rollback, and migrate.

SmartOS Zone Manipulation

Notes on snapshots, images, and migrations

Create Zone/KVM

# Create zone
vmadm create <<EOL
{
 "brand": "joyent",
 .
@soediro
soediro / dependencies.sh
Last active November 29, 2017 13:45 — forked from richardiux/dependencies.sh
golang on smartos with image magick
pkgin -y install git mercurial gcc47 gmake giflib-5.0.5 ImageMagick-6.8.7.4
export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/gocode
cd
git clone https://github.com/golang/go.git
cd go
hg update default
DAEMON_URL = http://<bitcoin.conf rpcuser>:<bitcoin.conf rpcpassowrd>@localhost:8332/
DB_DIRECTORY = /Users/bitcoin/.electrumx/
DB_ENGINE = leveldb
USERNAME = bitcoin
ELECTRUMX = /Users/bitcoin/source/electrumx/electrumx_server
HOST = 0.0.0.0
ANON_LOGS = fuck off :)
BANNER_FILE = /Users/bitcoin/.electrumx/banner.txt
DONATION_ADDRESS = 34ie35p4G1npt6GoXR9BDhmMndNwCsiiEr
@soediro
soediro / vmbup.sh
Last active April 17, 2019 15:33 — forked from baetheus/vmbup.sh
Zone Backup Script
#!/bin/sh
# This script will backup all smartos zones to remote servers
# or local directories.
# taken from Brandon Blaylock ([email protected])
### Defaults
FTPHOST=
SCPHOST=
LOCALDIR=
@soediro
soediro / Base64Servlet.java
Last active September 25, 2019 20:35 — forked from sjpuas/Base64Servlet.java
Servlet for decode base64 of images. You would change content type for others type.
package cl.puas.web.servlet;
import sun.misc.BASE64Decoder;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
@soediro
soediro / frebsd_laravel_install.md
Last active December 29, 2020 23:33 — forked from ar-android/frebsd_laravel_install.md
Setup FreeBSD 12.1-RELEASE-p11 Server for Laravel

Update Package

sudo pkg update

Install NGINX

sudo pkg install nginx
@soediro
soediro / letsencrypt_notes_openbsd.sh
Created October 1, 2020 11:22 — forked from Nothing4You/letsencrypt_notes_openbsd.sh
Set up LetsEncrypt using acme.sh without root on OpenBSD
# Modified for OpenBSD
# Assumes being root
# Requires curl to be installed, wget can also be used, relevant commands need to be adjusted. acme.sh supports both.
# Configured to use Cloudflare DNS for verification
# How to use "acme.sh" to set up Lets Encrypt without root permissions
# See https://github.com/Neilpang/acme.sh for more
# This assumes that your website has a webroot at "/var/www/<domain>"
# I'll use the domain "EXAMPLE.com" as an example