Skip to content

Instantly share code, notes, and snippets.

@lovellfelix
lovellfelix / websvr.sh
Created November 24, 2012 03:42
NGINX, PHP-FPM & MYSQL CENTOS INSTALLER
#!/bin/bash
##################
# disable apache #
##################
service httpd stop
chkconfig httpd off
service xinetd stop
chkconfig xinetd off
service saslauthd stop

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@lovellfelix
lovellfelix / AndroidSnippets.java
Last active December 16, 2015 04:19
Android Code Snippets
//Active Internet checker
public static boolean isNetworkConnected(Context context) {
ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
return (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isAvailable() && cm.getActiveNetworkInfo().isConnected());
}
//check for network activity
if(isNetworkConnected(this)){
//Internet is working
}else {
//Internet is not working

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/
## 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
@lovellfelix
lovellfelix / apache_proxy_server
Last active June 2, 2020 18:01
Using Apache as a proxy server.
<VirtualHost *:80>
Servername lb-test.example.com
Redirect / https://lb-test.example.com/
</VirtualHost>
<VirtualHost *:443>
Servername lb-test.example.com:443
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/example.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/example.com.key
@lovellfelix
lovellfelix / amanda-client-setup.sh
Created October 17, 2013 21:24
Amanda bash file setup on CentOS
#!/bin/bash
#INSTALLING AMANADA
yum install -y amanda amanda-client
#SETTING UP AMANDA CONFIG
su - amandabackup
rm -rf /var/lib/amanda/.amandahosts
<provider
android:name=".providers.AssetProvider"
android:authorities="@string/provider_asset"
android:multiprocess="true"
android:exported="true"/>
<provider
android:name=".providers.AssetTagProvider"
android:authorities="@string/provider_assettags"
android:multiprocess="true"