Skip to content

Instantly share code, notes, and snippets.

View ianmustafa's full-sized avatar

Ian Mustafa ianmustafa

  • Bojonegoro, Indonesia
View GitHub Profile
@Werninator
Werninator / compare.php
Created April 11, 2018 10:01
Compare two files in PHP
<?php
/**
* Compare the contents of two files and return if they're the same
*
* modified version of:
* https://jonlabelle.com/snippets/view/php/quickly-check-if-two-files-are-identical
*
* @param string $fileOne path to file One
* @param string $fileTwo path to file two
@artemisia-absynthium
artemisia-absynthium / AndroidManifest.xml
Last active November 19, 2022 10:34
Android Exoplayer fullscreen feature
...
<activity
android:name=".FullscreenVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:theme="@style/FullscreenTheme" />
...
@laurencei
laurencei / gist:d46893f833d5ddd439eccff025a0b63a
Last active May 7, 2021 16:40
Lumen vs Laravel performance steps
Steps to recreate tests:
// Create and configure server:
1. Create 2GB DigitalOcean server using Forge
2. Enable OpCache on server
3. Create http://domain1.com (use whatever domain name you have available)
4. Create http://domain2.com (use whatever domain name you have available)
5. Enable SSL on both domains using LetsEncrypt
6. Install: sudo apt-get install apache2-utils
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 29, 2024 03:21 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@ktrysmt
ktrysmt / .zshrc
Created May 26, 2017 15:37
using zplug in zsh
if [[ ! -d ~/.zplug ]];then
git clone https://github.com/zplug/zplug ~/.zplug
fi
source ~/.zplug/init.zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/command-not-found", from:oh-my-zsh
zplug "zsh-users/zsh-syntax-highlighting"
zplug "zsh-users/zsh-history-substring-search"
@michaelneu
michaelneu / Dockerfile
Last active October 17, 2022 05:37
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@SamEureka
SamEureka / nginx-ssl-proxy.md
Last active August 12, 2021 22:43
NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent

Installing NGINX SSL Reverse Proxy, w/ fail2ban, letsencrypt, and iptables-persistent.

The steps outlined here make many assumptions about both your operating environment and your understanding of the Linux OS and services running on Linux. I am using the current LTS Ubuntu distribution 16.04 running in the cloud on a DigitalOcean Droplet. These steps should work just fine if followed closely and in order... but you know sh!& never works out the way you plan in Linux. I offer some troubleshooting advice, Google and Stack are your friends ask them for help.
(Entered on your local workstation)
  1. ssh-add <path-to-ssh-key> and enter key passphrase when prompted. // ex path... /users/you/.ssh/id_rsa_digital-ocean
  2. ssh root@<server-url-or-IP> // should login without prompting for passphrase
(Entered on your remote server)
  1. adduser and follow prompts
@pavelbinar
pavelbinar / extract-subtitles-from-mkv.md
Last active December 24, 2023 12:10 — forked from bmaeser/subtitle-extract.txt
Extract subtitles from .mkv files on Mac OS X
@uorat
uorat / nginx-websocket-proxy.conf
Last active February 11, 2023 16:04
Nginx Reverse Proxy for WebSocket
upstream websocket {
server localhost:3000;
}
server {
listen 80;
server_name localhost;
access_log /var/log/nginx/websocket.access.log main;
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: