Skip to content

Instantly share code, notes, and snippets.

View takizo's full-sized avatar

CJ Ooi takizo

  • Kuala Lumpur
View GitHub Profile
@tamer-dahdul
tamer-dahdul / 01_httpd_phpfpm.config
Created July 4, 2020 20:45
Apache 2.4 / PHP-FPM 7.3 on Amazon Elastic Beanstalk
packages:
yum:
php73-fpm: []
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh":
mode: "000755"
owner: root
group: root
content: |
@allenday
allenday / make_TsvHttpData.pl
Last active September 3, 2018 10:07
Create URL list for Google Cloud Storage Transfer Service, see: https://cloud.google.com/storage/transfer/create-url-list
#!/usr/bin/perl
use strict;
my $http_base = shift;
my $path_base = shift;
my $prev_file = shift;
if ( ! $http_base || ! $path_base ) {
print STDERR <<"HERE";
USAGE:
import signal
import sys
from google.cloud import language
from google.api_core.exceptions import InvalidArgument
# create a Google Cloud Natural Languague API Python client
client = language.LanguageServiceClient()
@pstray
pstray / ssh-multi.sh
Last active September 28, 2023 18:07
Start tmux and ssh to multiple hosts with synchronized input
#! /bin/bash
if [ -z "$1" ]; then
echo "please supply at least one server to connect to" >&2
exit 1
fi
target=multi-ssh-$$
if [ -z "$TMUX" ]; then
@fevangelou
fevangelou / my.cnf
Last active May 10, 2024 10:05
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@titipata
titipata / macports_installation.md
Last active March 29, 2022 03:08
Easy description to install python using Macports

##Installing Python using Macports (beginner guide)

I think package management system is good for long-term installation. Since lab members use a lot of Apple product, I wrote Macports documentation which is package management system for Mac OSX which hopefully will be useful for members who use Mac. Note that this is not an official document but probably an easy way to get start with Macports. Macports depends mostly by its community and ones who update the port. We may have to migrate our ports when Mac announce new operating system. From my experience, it is normal to have some port problem with macports when new Mac operating system, for example, when Maverick or Yosemite was announced or when new XCode version were updated. It will take some time (a day or a week) for them to update the new port that are compatible with new operating system. But yeah, most ports work very well even though OS changes since the community is very active.

Macports

@kalinchernev
kalinchernev / countries
Created October 6, 2014 09:42
Plain text list of countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@mattzuba
mattzuba / 01_httpd_phpfpm.config
Last active December 20, 2022 19:53
Apache 2.4 / PHP-FPM 5.5 on Amazon Elastic Beanstalk
packages:
yum:
php55-fpm: []
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/26_phpfpm_config.sh":
mode: "000755"
owner: root
group: root
content: |
@lucaspiller
lucaspiller / auto-save-remote-images.php
Created February 19, 2014 15:19
Auto Save Remote Images WP Plugin
<?php
/*
Plugin Name: Auto Save Remote Image
Plugin URI: http://www.devsaab.com/wordpress/
Description: This plugin automatically downloads the first remote image from a post and sets it as the featured image.
Version: 1.3
Author: Prebhdev Singh
Disclaimer: No warranty or guarantee of any kind! Use this in your own risk.
*/
add_action('publish_post', 'fetch_images');
@dhensby
dhensby / install-tarsnap.sh
Last active May 19, 2020 02:29
A script to install tarsnap automatically on Fedora/CentOS/RHEL
#!/bin/bash
# To do:
# - Force install (regardless of installed tarsnap version) via flag
# - Set version via flag
# - Set TMP_DIR via flag
# - Skip software insall via flag
# - Check signature automatically
VERSION=1.0.37
TMP_DIR=/tmp/tarsnap
REMOVE_DIR=false