Skip to content

Instantly share code, notes, and snippets.

View thosuperman's full-sized avatar

Tho Nguyen thosuperman

View GitHub Profile
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@thosuperman
thosuperman / gist:4cb9fdeca0637c5cd591abd646df7977
Created September 7, 2016 09:21 — forked from zhannes/gist:3207394
Git rebase workflow
# first, fetch the latest refs for all branches. And be sure we have latest master, etc
git checkout master
git fetch
# If any changes from remote, catch our local version up
git rebase origin/master
# could also be done as
@thosuperman
thosuperman / usefull-validation.js
Created October 7, 2016 07:50 — forked from ulinkwo/usefull-validation.js
Some Usefull Validations
//validate string length
function ValidLen(s,min,max){
if (s.length < min || s.length > max) { return false; }
return true;
}
// validate email
function ValidEmail(s){
var check = /^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/;
if (!check.test(s)) { return false; }
@thosuperman
thosuperman / gist:7f234135991782cb689b2f15dbd96cc0
Created March 25, 2017 18:27 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@thosuperman
thosuperman / add-new-crypto-to-peatio.md
Created August 15, 2017 11:36 — forked from brossi/add-new-crypto-to-peatio.md
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
@thosuperman
thosuperman / ConvertUTF-8.py
Created August 24, 2017 03:33 — forked from smccutchen/ConvertUTF-8.py
Convert multiple files to UTF-8 encoding with Notepad++
# 2016-2017 Soverance Studios.
# Scott McCutchen
# This file will search all files and folders within a given directory, and use Notepad++ to convert their encoding to UTF-8 without Byte Order Marks
#
# This file must be run using the PythonScript plugin from within Notepad++, which is available through the Notepad++ Plugin Manager
#
# You must have Python 2.7 installed
#
# Additionally, this script can only exist and be run from within the Notepad++ user's working directory, the default of which is here:
@thosuperman
thosuperman / readme.md
Created September 4, 2017 08:05 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@thosuperman
thosuperman / Compile_Bitcoin_on_Ubuntu_14_04
Last active September 13, 2017 03:12 — forked from kostaz/Compile_Bitcoin_on_Ubuntu_14_04
Compile Bitcoin on Ubuntu 14.04
Assuming the username of the Ubuntu user is "ubuntu".
Preparation
-----------
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev