Skip to content

Instantly share code, notes, and snippets.

View olragon's full-sized avatar
👨‍💻
I may be slow to respond.

Long Nguyen olragon

👨‍💻
I may be slow to respond.
  • Ho Chi Minh City, Viet Nam
View GitHub Profile
@olragon
olragon / fix.sh
Created October 18, 2016 14:32
Install Mac OS X El Capitan on PC on VirtualBox on Ubuntu
#!/bin/bash
VM=$1
if [[ -z "$1" ]]; then
echo "Please provide your VM name."
echo " ./fix.sh \"OS X El Capitan Final\""
echo "To list your VM"
echo " VBoxManage list vms"
exit 1;
fi
@olragon
olragon / bash
Last active May 3, 2021 20:11
Phan with Drupal
# Find all PHP files and save to phan_files.txt
find ./ -type f -name "*.module" \
-o -name "*.php" \
-o -name "*.inc" \
-o -name "*.engine" \
-o -name "*.install" \
-o -name "*.test" \
-o -name "*.theme" \
> phan_files.txt
@olragon
olragon / Layout.php
Created June 3, 2016 04:05
Magento 1.9.1.0 with PHP 7 - patch
<?php
// link: https://www.atwix.com/magento/magento-and-php-7/
// file: app/code/core/Mage/Core/Model/Layout.php
// line: 555
$out .= $this->getBlock($callback[0])->$callback[1]();
// should be
$out .= $this->getBlock($callback[0])->{$callback[1]}();
@olragon
olragon / Install
Created February 2, 2016 11:45
phpbrew
# Install GD extension
phpbrew -d ext install gd -- --with-libdir=lib/x86_64-linux-gnu --with-gd=shared --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-freetype-dir=/usr/include/freetype2/ft2build.h --with-xpm-dir=/usr
@olragon
olragon / count.sh
Last active February 2, 2016 07:44
Recursive count and sort by file extension in directory
find ./ -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n
@olragon
olragon / gist:77200d913fa90a894a6c
Last active November 6, 2017 21:48 — forked from daz/ffmpeg-x264.sh
Cross-compile ffmpeg with x264 for Raspberry Pi 2
# Build environment. I use vagrant ubuntu/trusty64
sudo apt-get install build-essential git-core alsa-base
sudo git clone https://github.com/raspberrypi/tools.git /opt/tools
export CCPREFIX="/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-"
# Get ffmpeg and x264 repos
git clone git://source.ffmpeg.org/ffmpeg.git
# add the email package
meteor add email
@olragon
olragon / README.md
Created June 10, 2015 14:38
Fix drush simplexml_load_file(): I/O warning : failed to load external entity "" Project.php:72

Fix: drush-ops/drush#894 Super quick, insecure and dirty solution for now. You shouldn't use.

File ./includes/drush.inc, add --no-check-certificate for wget command, --insecure for curl command.

  // ...
  if ($use_wget) {
    drush_shell_exec("wget --no-check-certificate -q --timeout=30 -O %s %s", $destination_tmp, $url);
  }
 else {
{
"id": 9118195,
"name": "keyboard",
"full_name": "jasonrudolph/keyboard",
"owner": {
"login": "jasonrudolph",
"id": 2988,
"avatar_url": "https://avatars.githubusercontent.com/u/2988?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/jasonrudolph",
@olragon
olragon / .my.cnf
Created April 12, 2015 05:34
Backup MySQL databases, backup files split by date-time and database name
# file: /root/.my.cnf
[client]
user = MYSQL_USER
password = MYSQL_PASSWORD
host = MYSQL_HOST