Skip to content

Instantly share code, notes, and snippets.

@faizal2007
faizal2007 / LICENSE
Last active December 7, 2017 20:30
Bash Image Optimization for web
The MIT License (MIT)
Copyright (c) 2013 wackoen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@faizal2007
faizal2007 / LICENSE
Last active August 29, 2015 13:57
Shorewall blacklist IP
The MIT License (MIT)
Copyright (c) 2013 wackoen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@faizal2007
faizal2007 / macgen
Created April 22, 2014 19:14
Generate mac address
#!/usr/bin/perl -w
##
#
# Generate mac address
#
##
for ($i=0;$i<5;$i++){$m[$i]=int(rand(256));} printf "02:%X:%X:%X:%X:%X\n",@m;
@faizal2007
faizal2007 / macgen.pl
Created December 1, 2014 20:03
Create mac address
#!/usr/bin/perl -w
##
#
# Generate mac address
#
##
for ($i=0;$i<5;$i++){$m[$i]=int(rand(256));} printf "02:%X:%X:%X:%X:%X\n",@m;
# phpMyAdmin default Apache configuration
Alias /dbadmin /var/www/dbadmin
<Directory /var/www/dbadmin>
Options FollowSymLinks
DirectoryIndex index.php
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
@faizal2007
faizal2007 / ssh-port-forward.sh
Last active September 4, 2015 17:21
SSH Remote Port Forwarding
#!/bin/bash
##
#
# @package Localhost Port Forwarder
# Allow access private server behind firewall
#
# @todo
# + Server config save
# + Multiple server port
# + Switch port forward type L - Local Port R - Remote Port
@faizal2007
faizal2007 / overrite-output.sh
Created April 21, 2016 04:19
Over rite output line by line
#!/bin/bash
c=5 # seconds to wait
REWRITE="\e[25D\e[1A\e[K"
echo "Starting..."
while [ $c -gt 0 ]; do
c=$((c-1))
sleep 1
echo -e "${REWRITE}Backup Bola..$c"
done
@faizal2007
faizal2007 / check_mysql_remote.sh
Created October 18, 2016 10:49
Check mysql remote port access
#!/bin/bash
SERVER=db2
PORT=3306
(echo > /dev/tcp/$SERVER/$PORT)
if [ "$?" -ne 0 ]; then
echo "Connection to $SERVER on port $PORT failed"
/etc/init.d/mysql stop
/etc/init.d/mysql bootstrap
exit 1
@faizal2007
faizal2007 / xen-conf
Last active October 24, 2023 03:32
Xen cfg file for creating centos using iso
# Sample centos xen config file
vcpus = '2'
memory = '2046'
#
# Disk device(s).
#
# Comment 'file:/home/freakie/CentOS-7-x86_64-Minimal-1611.iso,hdc:cdrom,r' after installation complete
disk = [
@faizal2007
faizal2007 / custom-options-5.2.17.sh
Created May 3, 2017 23:41
phpfarm compile option
#!/bin/bash
# You can override config options very easily.
# Just create a custom options file; it may be version specific:
# - custom-options.sh
# - custom-options-5.sh
# - custom-options-5.3.sh
# - custom-options-5.3.1.sh
#
# Don't touch this file here - it would prevent you to just "svn up"
# your phpfarm source code.