Skip to content

Instantly share code, notes, and snippets.

View rubyf2e's full-sized avatar

Ruby rubyf2e

  • taiwan
View GitHub Profile
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active October 5, 2025 08:00
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@mpijierro
mpijierro / download_csv.php
Last active February 4, 2026 08:45
Example streaming large CSV files with Laravel and thousands of queries
<?php
namespace Src\Csv;
use Illuminate\Http\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
/**
* Class DownloadLargeCsv
*
@pecigonzalo
pecigonzalo / delete_all_object_versions.sh
Last active July 25, 2022 21:12 — forked from weavenet/delete_all_object_versions.sh
Delete all versions (except latest) of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions | .[] | select(.IsLatest | not)'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
@LeZuse
LeZuse / nginx-dev-ssl.sh
Last active December 9, 2018 06:23
nginx development SSL setup on localhost
# copy default OpenSSL config
cp /usr/local/etc/openssl/openssl.cnf .
# make changes according to https://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/
vim openssl.cnf
# [alt_names]
# DNS.1 = localhost
# IP.1 = 0.0.0.0
# IP.2 = 127.0.0.1
@shashankmehta
shashankmehta / setup.md
Last active November 18, 2024 18:33
Setup PHP and Composer on OSX via Brew

First install Brew on your MAC

  • Setup Brew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew update
  • brew tap homebrew/dupes
  • brew tap homebrew/php
  • Install PHP 7.0.+ brew install php70
  • Install mcrypt: brew install mcrypt php70-mcrypt
  • Finally, install composer: brew install composer
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active February 25, 2026 03:40
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:

@dtomasi
dtomasi / default
Last active January 26, 2026 13:35
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@soifou
soifou / PHPBrew.md
Last active September 8, 2021 18:08
PHPBrew - Manage PHP versions efficiently

PHPBrew

Dependencies

$ apt-get install -y \
    autoconf automake curl libcurl3-openssl-dev build-essential libxslt1-dev \
    re2c libxml2 libxml2-dev bison libbz2-dev libreadline-dev \
    libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev \
 libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev \
@subfuzion
subfuzion / curl.md
Last active March 23, 2026 03:03
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@chuyihuang
chuyihuang / gist:3d45d60e232b4a26b036
Created November 22, 2015 16:23
使用sequel pro登入docker container中的mysql
找出想要進入的image的名稱:
docker-machine ls #通常是default
取得當前docker image的ip:
docker-machine ip default #以default為例
取出ip後,以192.168.99.100為例,找出這個image的使用者帳密。通常使用者是docker,密碼是tcuser。
可以透過docker-machine ssh default進入default這個machine修改密碼。