Skip to content

Instantly share code, notes, and snippets.

View pritdeveloper's full-sized avatar
🏠
Working from home

Pritpal Singh pritdeveloper

🏠
Working from home
View GitHub Profile

Startup steps for AWS Cloud9

These are the startup steps for AWS Cloud9. The Platform should be set to Ubuntu Server 18.04 LTS.

Git Config and global .gitignore file

  • Setup the git configuration variables
     git config --global user.name "Pritpal Singh"
     git config --global user.email "pritdeveloper+git@gmail.com"
     git config --global core.excludesfile "~/.gitignore"
     git config --global color.ui true
<VirtualHost *:80>
DocumentRoot /home/ubuntu/environment
LogLevel info
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/ubuntu/environment>
Options Indexes FollowSymLinks
@pritdeveloper
pritdeveloper / reset root MySQL password on Ubuntu 18.04.md
Last active July 28, 2021 15:27
reset root MySQL password on Ubuntu 18.04

How to reset root MySQL password on Ubuntu 18.04 Bionic Beaver Linux

sudo service mysql stop
sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
mysql -u root
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install libapache2-mod-php7.2
sudo a2dismod php5
sudo a2enmod php7.2
sudo apt-get install php7.2-dom php7.2-mbstring php7.2-zip php7.2-mysql php7.2-sqlite php7.2-curl php7.2-gd
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install libapache2-mod-php7.1
sudo a2dismod php5
sudo a2enmod php7.1
sudo apt-get install php7.1-dom php7.1-mbstring php7.1-zip php7.1-mysql php7.1-sqlite php7.1-curl php7.1-gd
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install libapache2-mod-php7.0
sudo a2dismod php5
sudo a2enmod php7.0
sudo apt-get install php7.0-dom php7.0-mbstring php7.0-zip php7.0-mysql php7.0-sqlite php7.0-curl php7.0-gd
@pritdeveloper
pritdeveloper / wc_order_status_changes.php
Created August 3, 2018 14:56 — forked from abegit/wc_order_status_changes.php
WooCommerce Hooks for Order Status Changes
function mysite_pending($order_id) {
error_log("$order_id set to PENDING", 0);
}
function mysite_failed($order_id) {
error_log("$order_id set to FAILED", 0);
}
function mysite_hold($order_id) {
error_log("$order_id set to ON HOLD", 0);
}
function mysite_processing($order_id) {
// define plugin variables
define( 'PLUGIN_PATH', rtrim( plugin_dir_path( __FILE__ ), '/' ) );
define( 'PLUGIN_URL', rtrim( plugin_dir_url( __FILE__ ), '/' ) );
@pritdeveloper
pritdeveloper / git_aliases
Last active September 1, 2018 22:46
aliases for git | curl {RAW_URL} >> ~/.gitconfig
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
le = log --oneline --decorate
fl = log -u
if( !function_exists( 'pr' ) ) {
function pr() {
foreach( func_get_args() as $e ) {
echo "<pre>";
print_r( $e );
echo "</pre>";
}
}
}