Skip to content

Instantly share code, notes, and snippets.

View firmanelhakim's full-sized avatar

Firman El Hakim firmanelhakim

View GitHub Profile
@firmanelhakim
firmanelhakim / HowTo.md
Last active November 6, 2021 08:54
How to Run YouTube Downloader from Docker

AllTube

docker run -d --name alltube --log-opt max-size=50m --restart unless-stopped rudloff/alltube

Caddy as Reverse Proxy

Caddyfile
{
  # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
  email [email protected]
}
@firmanelhakim
firmanelhakim / HowTo.md
Created April 22, 2020 09:43
How to Run Caddy (Reverse Proxy) on Docker

docker run -d --network host --name caddy -p 80:80 -p 443:443 -v $(pwd)/Caddyfile:/etc/caddy/Caddyfile -v $(pwd)/caddy_data:/data caddy/caddy

Caddyfile
{
  # acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
  email [email protected]
}

doesnt-exists.com {
@firmanelhakim
firmanelhakim / HowTo.md
Created April 22, 2020 07:21
How to Run MSSQL on Docker

docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Passw0rd123!' -e 'MSSQL_PID=Express' -p 1434:1433 -d --name mssql mcr.microsoft.com/mssql/server:2017-latest-ubuntu

docker exec -it mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd123!'

@firmanelhakim
firmanelhakim / HowTo.md
Created June 29, 2018 07:39
How to Install Python without Admin Rights in Windows

From the Python website, download the MSI version of Python you wish to install.

Then open your command prompt and use this command:

msiexec /a python-2.7.10.msi /qb TARGETDIR=C:\python27

Substitute python-2.7.10.msi, if you downloaded Python 3 and adjust your target directory to where you want it to go.

The /qb flag will give you a small dialog progress bar.

@firmanelhakim
firmanelhakim / random_file.sh
Created September 27, 2017 07:12
Generate Random Text File in Linux
#!/bin/sh
base64 /dev/urandom | head -c 102400000 > urandom.txt
python -c 'import sys; a1="abcdefghijklmnopqrstuvwxyz0123456789"; a2=a1[::-1]; a=a1+a2[1:]; size=102400000; [sys.stdout.write(a) for i in range(1,size,len(a))]' > fast.txt
openssl rand 75000000 -base64 -out rand.txt
@firmanelhakim
firmanelhakim / HowTo.md
Created August 14, 2017 22:51
How to Convert from DOCX to PDF using LibreOffice

Download LibreOffice

x86_64

wget -t 0 -c http://download.documentfoundation.org/libreoffice/stable/5.4.0/deb/x86_64/LibreOffice_5.4.0_Linux_x86-64_deb.tar.gz

x86

wget -t 0 -c http://download.documentfoundation.org/libreoffice/stable/5.4.0/deb/x86/LibreOffice_5.4.0_Linux_x86_deb.tar.gz

Install Required Packages

sudo apt-get install -y libxinerama1 libdbus-glib-1.2 libcairo2 libsm6

@firmanelhakim
firmanelhakim / sources.list
Created August 4, 2017 12:25
Debian Jessie Repository List - /etc/apt/sources.list
deb http://httpredir.debian.org/debian jessie main contrib non-free
deb-src http://httpredir.debian.org/debian jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb http://httpredir.debian.org/debian jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian jessie-updates main contrib non-free
@firmanelhakim
firmanelhakim / HowTo.md
Last active August 4, 2017 12:29
How to Install Python with Miniconda, Scrapy, Selenium, PhantomJS and PyMongo on Debian 8 (Jessie)

You might need to execute the following commands as root, or use sudo.

Make sure everything is updated

apt-get update && apt-get upgrade -y

Install Miniconda

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh
@firmanelhakim
firmanelhakim / download_vagrant_box.sh
Last active July 8, 2024 16:37
How to Download Vagrant Box Manually
/* this is the box (and the version) that we want to download from: https://app.vagrantup.com/debian/boxes/jessie64 */
wget https://app.vagrantup.com/debian/boxes/jessie64/versions/8.9.0/providers/virtualbox.box -O debian-jessie64-8.9.0.box
/* add the box to vagrant */
vagrant box add debian/jessie64 debian-jessie64-8.9.0.box
/* update box version */
cd ~/.vagrant.d/boxes/debian-VAGRANTSLASH-jessie64/
mv 0 8.9.0
@firmanelhakim
firmanelhakim / dynamic_forms_builder.sql
Created July 13, 2017 07:11
Dynamic Forms Builder using PostgreSQL
CREATE TABLE master.forms
(
form_id serial NOT NULL,
code CHARACTER VARYING,
name CHARACTER VARYING,
description CHARACTER VARYING,
properties jsonb,
audit_trails jsonb,
stereotype CHARACTER VARYING,
sort_order INTEGER,