Skip to content

Instantly share code, notes, and snippets.

@nocoo
nocoo / gist:a617b2f28c6ac586025fc0123904930e
Created December 25, 2017 06:54
WSL mysql_upgrade failed with exit status 11
sudo apt-get remove --purge 'mysql*'
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mysql-server
@nocoo
nocoo / gist:aed76b5262d49a2f7de340505473bf34
Created August 23, 2017 00:56
Gradle to extract all dependencies as AAR
# In project build.gradle:
task copyDeps(type: Copy) {
from (configurations.compile) {
include "*.jar","*.aar"
include ".so", ".dll"
}
into rootProject.rootDir.getAbsolutePath()+"/lib"
}
@nocoo
nocoo / fix.sh
Created April 18, 2015 00:23
Mac OS fix error code -50 while copying files to NAS/SMB share
cd /path/to/your/folder;
sudo find ./ -name ".DS_Store" -depth -exec rm {} \;
sudo find ./ -name ".AppleDouble" -depth -exec rm -rf {} \;
@nocoo
nocoo / gist:6bee9341e485d1e7e3ab
Created August 28, 2014 02:02
Setting locale failed
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
@nocoo
nocoo / Bridge.h
Created July 24, 2014 05:33
Swift MD5 support to String
#import <CommonCrypto/CommonCrypto.h>
@nocoo
nocoo / install.sh
Last active August 29, 2015 14:01
Install newrelic sysmon on ubuntu server
wget http://download.newrelic.com/server_monitor/release/newrelic-sysmond-1.4.0.471-linux.tar.gz
tar zxvf newrelic-sysmond-1.4.0.471-linux.tar.gz
cd newrelic-sysmond-1.4.0.471-linux
cp daemon/nrsysmond.x64 /usr/sbin/nrsysmond
cp scripts/nrsysmond-config /usr/sbin
mkdir -p /etc/newrelic
mkdir -p /var/log/newrelic
cp nrsysmond.cfg /etc/newrelic/nrsysmond.cfg
/usr/sbin/nrsysmond-config --set license_key={YOURKEY}
cp scripts/newrelic-sysmond.init.debian /etc/init.d/newrelic
@nocoo
nocoo / gist:10710403
Created April 15, 2014 07:31
ubuntu with PHP/nginx/php-fpm/mysql
apt-get install mysql-server mysql-client
apt-get install nginx
apt-get install php5-fpm
apt-get install php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt php5-memcache
@nocoo
nocoo / gist:10224170
Created April 9, 2014 03:43
Work around for "libjpeg.(a|so) not found"
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib/x86_64-linux-gnu/libpng.so /usr/lib/libpng.so
@nocoo
nocoo / gist:10222877
Created April 9, 2014 03:14
Compile install PHP 5.3.28
# Install dependency libs of PHP5
aptitude build-dep php5
# Add this one
aptitude install libmcrypt-dev
./configure --prefix=/usr/local/php53 \
--with-config-file-path=/etc/php53 \
--with-config-file-scan-dir=/etc/php53/conf.d \
--without-t1lib \
@nocoo
nocoo / gist:10219971
Last active August 29, 2015 13:58
MotoCMS permissions
chmod 555 ./ -R
chmod 664 ./xml -R
chmod 664 ./config.xml
chmod 664 ./admin/config.xml
chmod 664 ./admin/data/users.xml
chmod 664 ./admin/xml/ -R
chmod 664 ./admin/_tmp/ -R
chmod 664 ./m/xml/ -R
chmod 664 ./m/template/ -R