This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-software-properties | |
sudo apt-get install software-properties-common | |
# install nginx | |
# add the repository ppa | |
sudo add-apt-repository ppa:nginx/stable | |
sudo add-apt-repository ppa:ondrej/php5-oldstable | |
sudo add-apt-repository ppa:ondrej/php5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BUILDDIR=/tmp/phpimapmountainlion | |
# Original Script found at: | |
# http://blog.vucica.net/2012/10/installing-imap-extension-for-php-on-mountain-lion.html | |
mkdir "$BUILDDIR" | |
echo " " | |
echo "= FETCHING AND INSTALLING IMAP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4122 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to convert PDF file to JPG images | |
# | |
# Dependencies: | |
# * pdftk | |
# * imagemagick | |
PDF=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# @see http://www.cyberciti.biz/tips/howto-write-shell-script-to-add-user.html | |
# Script to add a user to Linux system | |
if [ $(id -u) -eq 0 ]; then | |
read -p "Enter username : " username | |
read -s -p "Enter password : " password | |
egrep "^$username" /etc/passwd >/dev/null | |
if [ $? -eq 0 ]; then | |
echo "$username exists!" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget http://mirrors.163.com/.help/CentOS6-Base-163.rep | |
cd /etc/yum.repos.d/ | |
## !important backup the system yum repo | |
mv CentOS-Base.repo CentOS-Base.repo.bak | |
mv /path/to/CentOS6-Base-163.repo CentOS-Base.repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason I wanted to share this post is configuring static IP on CentOS seems to trouble many centos users. Probably, when you configure static IP, network may not work as you expected, sometimes no internet access, sometimes no IP address on eth0 etc.. | |
First, "watch-out whether it is a CentOS Desktop version or Server version".? because they are runs at different run-levels, where; | |
- Desktop ver runs on run-level 5 | |
- Server ver runs on run-level 3 | |
Second, watch-out the configuration on | |
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
NewerOlder