Skip to content

Instantly share code, notes, and snippets.

View growtopiajaw's full-sized avatar
🏠
Working from home

Growtopia Jaw growtopiajaw

🏠
Working from home
  • gjaw.duckdns.org
  • Malaysia
View GitHub Profile
@growtopiajaw
growtopiajaw / virtualbox-ostypes.md
Last active July 26, 2019 10:38
Oracle VM VirtualBox complete ostypes list
@growtopiajaw
growtopiajaw / .chroot.sh
Last active August 4, 2019 07:05
A sample chroot script for managing a Bitnami LAMP Stack webserver on another disk and an All-In-One (AIO) webserver startup script
#! /bin/bash -l
## exit immediately if a command exits non-zero
set -e
## script name
script_n="$(basename $0)"
## start daemon mode if -d or --daemon parameter is passed
if [ "$1" = "-d" ] || [ "$1" = "--daemon" ]; then
@growtopiajaw
growtopiajaw / vsftpd.conf
Last active August 3, 2019 08:35
A sample vsftpd.conf for Amazon AWS EC2 Instance
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
uid = vsftpd
gid = vsftpd
timeout = 600
log file = /var/log/rsyncd.log
transfer logging = true
motd file = /etc/rsyncdmotd
[LDP]
comment = The Linux Documentation Project (tldp.org)
path = /home/vsftpd/LDP
#! /bin/bash -l
## exit immediately if a command exits non-zero
set -e
## update aws ec2 instance ipv4 address to duckdns and get the log of the exit status
echo url="https://www.duckdns.org/update?domains=<domain>&token=<token>&verbose=true&ip=" | curl -k -o /home/bitnami/duck.log -K -
## set vncserver depth, geometry and pixelformat
vncserver -depth 16 -geometry 800x600 -pixelformat rgb565
# Default Virtual Host configuration.
<IfVersion < 2.3 >
NameVirtualHost *:80
NameVirtualHost *:443
</IfVersion>
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache2/htdocs"
RewriteEngine On
<html>
<head>
<script type="text/javascript" src="/var/www/html/First Game!/brython-master/www/src/brython.js"></script>
<script type="text/javascript" src="/var/www/html/First Game!/brython-master/www/src/py_VFS.js"></script>
<script type="text/python">
#!/usr/bin/python3
@growtopiajaw
growtopiajaw / renew.sh
Created August 13, 2019 13:01
A sample Let's Encrypt renew script to renew a webserver with Apache & DNS-01 challenge method
#! /bin/bash
#root@growtopiajaw:/etc/letsencrypt# certbot -i apache -a manual -d example.com -d *.example.com --preferred-challenges dns
#Saving debug log to /var/log/letsencrypt/letsencrypt.log
#Plugins selected: Authenticator manual, Installer apache
#Cert not yet due for renewal
#
#You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
#(ref: /etc/letsencrypt/renewal/example.com.conf)
#
#!/bin/bash
if [ -r /etc/os-release ]; then
echo " detecting OS type : "
. /etc/os-release
if [ $ID == "debian" ]; then
#
# ljdl.py - Linux Journal archive downloader
# GYS 2017-12-05
import sys
import os
import urllib.request
# arguments
if len(sys.argv) <= 3: