Skip to content

Instantly share code, notes, and snippets.

View hussanhijazi's full-sized avatar

Houssan Ali Hijazi hussanhijazi

View GitHub Profile
#!/bin/bash
cd /home/user/projectgit
git add ./
echo -n "- Type a message: "
read character
if [ "$character" = "" ]; then
message="$(date)"
else
message=$character
fi
#!/bin/bash
cd /home/site/git
git add ./
echo -n "- Digite a mensagem: "
read character
if [ "$character" = "" ]; then
message="$(date)"
else
message=$character
fi
@hussanhijazi
hussanhijazi / mencoder
Last active December 26, 2015 11:29
mencoder
mencoder Life.of.Pi.2012.WEB-DL.XviD-3LT0N.avi -sub Life.of.Pi.2012.WEB-DL.XviD-3LT0N.srt -oac pcm -ovc lavc -o filmeLegendado.avi -subcp latin1
@hussanhijazi
hussanhijazi / create_site.sh
Created October 24, 2013 20:52
domain creation
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 27/11/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@hussanhijazi
hussanhijazi / gist:7236420
Created October 30, 2013 17:15
submodule git
git submodule update --init --recursive
@hussanhijazi
hussanhijazi / gist:7600550
Created November 22, 2013 14:17
Start deamon
#!/bin/sh
#
# /etc/init.d/mysystem
# Subsystem file for "MySystem" server
#
# chkconfig: 2345 95 05 (1)
# description: MySystem server daemon
#
# processname: MySystem
# config: /etc/MySystem/mySystem.conf
@hussanhijazi
hussanhijazi / gist:7769156
Created December 3, 2013 13:32
find files execute command
find . -name \*.jpg -exec jpegoptim --strip-all {} \;
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
@hussanhijazi
hussanhijazi / gist:7997504
Last active December 31, 2015 13:59
bash script conta processos
while [[ true ]] ; do ps aux | grep php-fpm | wc -l; sleep 1 ; done;
ps -ylC php5-fpm --sort:rss | awk '!/RSS/ { s+=$8 } END { printf "%s\n", "Total memory used by PHP-FPM child processes: "; printf "%dM\n", s/1024 }'
@hussanhijazi
hussanhijazi / gist:8042069
Created December 19, 2013 16:28
google drive sublime
#!/bin/sh
#
# Set-up Sublime settings + packages sync over Dropbox
#
# Will sync settings + Installed plug-ins
#
# Tested on OSX - should support Linux too as long as
# you set-up correct SOURCE folder
#
# Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com