Make Startup Script on CentOS

Sebenarnya membuat script startup bisa dengan mengedit file rc.local yang ada pada /etc/rc.d/
Namun ane lebih suka dengan menggunakan script, jadi sita bisa menggunakan command “service namaprogram start / stop / restart..

Dan semua jenis program bisa dijalankan lewat script iniLangsung aja ya..

1. Buat file baru yang bernamakan “NamaService” (boleh diganti sesuai dengan program yang ingin kalian buat) yang isinya sebagai berikut.



Port Forwarding Mikrotik Using DMZ or PPPoE

if dial-in modem (you must download the DMZ interface Mikrotik)
use in-physical interface leading to the modem

modem = 192.168.1.1 (DMZ to 192.168.1.2)
ether1(modem) = 192.168.1.2
local webserver = 10.0.0.1/24

example DMZ

#port forwarding to local ssh
/ip firewall nat add chain=dstnat in-interface=ether1 dst-address=192.168.1.2 protocol=tcp dst-port=22 action=dst-nat to-address=10.0.0.1 to-port=22



Redirect to www & vise versa (htaccess)

Edit your .htaccess place this code after RewriteEngine On
This lines makes redirection to www

# Redirect if NOT www.example.com (exactly) to www.example.com
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

or

# Redirect if example.com (case-insensitive) to www.example.com
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Use non-www redirect

Show hidden files in cPanel file manager

When you click on File Manager, do you get a popup box asking where do you want to go to? (NOT THE FILE MANAGER ITSELF!)

If yes:

Check the box "Show Hidden Files", and then continue normally.

If no:



Hide tray icon

Do you need to hide a program running in the background that shows in your System Tray? Try this reg hack to hide all tray icons. It’s not anything like the Windows XP tray icon hider, this one shows no trace of any icons. It would look like someone closed all background programs.

1) Click on START>RUN and type "regedit" (without the quotes).
Navigate to the following key;