Skip to content

Instantly share code, notes, and snippets.

View samsulmaarif's full-sized avatar

Samsul Ma'arif samsulmaarif

View GitHub Profile
@alsoknownasdrew
alsoknownasdrew / webdev_online_resources.md
Last active August 22, 2018 08:04 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@ErikSaunier
ErikSaunier / cloud-sql-proxy.service
Created May 30, 2018 12:08
How to install Cloud SQL Proxy on Compute Engine instance and make it start on boot with Systemd
[Unit]
Description=Connecting MySQL Client from Compute Engine using the Cloud SQL Proxy
Documentation=https://cloud.google.com/sql/docs/mysql/connect-compute-engine
Requires=networking.service
After=networking.service
[Service]
WorkingDirectory=/usr/local/bin
ExecStart=/usr/local/bin/cloud_sql_proxy -dir=/var/run/cloud-sql-proxy -instances=<INSTANCE_CONNECTION_NAME>=tcp:3306
Restart=always
@gorbiz
gorbiz / Dockerfile
Created February 27, 2018 06:57
Multi-stage build for vue front-end
FROM node:8.9.4-alpine AS build_box
WORKDIR /app
COPY package*.json ./
RUN NODE_ENV=dev npm install
COPY . /app
RUN npm run build
# Make final image
FROM node:8.9.4-alpine
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 15:48
Bash getopt long options with values usage example.

Bash getopt long options with values usage example

#!/bin/bash -e

ARGUMENT_LIST=(
  "arg-one"
  "arg-two"
  "arg-three"
)
@GAS85
GAS85 / apache_ssl.md
Last active March 14, 2024 16:40
Apache 2.4.18+ with Letsencrypt on Ubuntu 20.04 - SSL config for A+ on SSLLabs.com

Prerequisites

  • Ubuntu 20.04 (18.04, 16.04 works the same)
  • Apache 2.4.18 or higher
  • OpenSSL 1.0.2g-1ubuntu4.10 or higher
  • e.g. LetsEncrypt certificate
OS: Ubuntu 20.04 Apache/2.4.18 1.0.2g-1ubuntu4.10 +
#!/usr/bin/env sh
TITLE="DOCKER BUILDER SCRIPT" # script name
VER="1.4" # script version
ENV="0" # container environment (0 = development, 1 = production)
SKIP_BUILD="0" # (0 = with build process, 1 = bypass build process)
REMOVE_CACHE="0" # (0 = using cache, 1 = no-cache)
RECREATE_CONTAINER="0" # (0 = disable recreate container, 1 = force recreate container)
DAEMON_MODE="0" # (0 = disable daemon mode, 1 = running daemon mode / background)
@eyecatchup
eyecatchup / 1.txt
Last active April 30, 2018 09:30
Safe flashing of hammerhead-lpx13d-preview-f7596f51 - FOR THE "GOOGLE_EXPERIENCE" DO NOT USE flash-all.sh (or flash-all.bat)
# Boot into bootloader mode
>adb reboot bootloader
# Erase old boot, cache, system & userdata partitions
>fastboot erase boot
>fastboot erase cache
>fastboot erase system
>fastboot erase userdata
# IGNORE THIS COMMAND, IF YOU HAVE A CUSTOM RECOVERY INSTALLED AND WANT TO KEEP IT.
@denji
denji / nginx-tuning.md
Last active November 5, 2024 10:10
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@dashohoxha
dashohoxha / install_wifi_access_point.sh
Last active June 7, 2024 18:03
How to setup a Wifi Access Point on Ubuntu 12.04 (or its derivatives).
#!/bin/bash
### Setup a wifi Access Point on Ubuntu 12.04 (or its derivatives).
### make sure that this script is executed from root
if [ $(whoami) != 'root' ]
then
echo "
This script should be executed as root or with sudo:
sudo $0
"