Server apt-get install openvpn go into /etc/openvpn/, make a directory easy-rsa ( mkdir easy-rsa ), then run the below command accordingly to your release version :- Wheezy cp -R /usr/share/doc/openvpn/examples/easy-rsa/2.0* easy-rsa/ Jessie and above apt-get install easy-rsa cp -R /usr/share/easy-rsa/* easy-rsa/ Edit /etc/openvpn/easy-rsa/vars bottom according to your organization. Then execute the following command # cd […]
Cronjob
Cronjob is an application that auto run some script at the desired time . Cronjob’s script have to include full path either in script or in crontab -e Here is a quick tools that you can set your time range for running your script:- Crontab.guru
Show exact filesize for each folder
This command line shows the exact file size of each folder and file :- du -sh *
Lxc Container
lxc-create -t download -n my-container The download template will show you a list of distributions, versions and architectures to choose from. A good example would be “ubuntu”, “trusty” (14.04 LTS) and “i386”. How to ssh into lxc as root: 1:lxc-attach -n my-container 2:to apt-get install ssh 3:vim /etc/ssh/sshd_config 4:Go to line 28: “PermitRootLogin” Change it […]
Flexbox
Hi, i have recently discover a CSS coding pattern named as flexbox , it can do floating stuff , margin stuff easily by a line or two codes. Parent div should have the css {display:flex;} and you can play around with the variables here :- https://codepen.io/osublake/pen/dMLQJr
How to install wordpress (Linux)
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
Reserve Engineer (Getting Source Code From APK)
Follow the instruction to see the installation of APK tools http://forum.xda-developers.com/showthread.php?t=2213985 The link above show how to decompile and rebuild the application and sign the apk…..
Time Zone for PHP & Linux
Linux System Time ln -sf /usr/share/zoneinfo/Asia/Kuala_Lumpur localtime Reference : http://www.thegeekstuff.com/2010/09/change-timezone-in-linux/ Php Time Method 1 : Add #date_default_timezone_set(‘Asia/Kuala_Lumpur’); At the starting of your script Method 2 : Find for /etc/php5/apache2/php.ini file Update to date.timezone = ‘Asia/Kuala_Lumpur’ LINE 883 /etc/init.d/php5-fpm restart
Ajax (Client’s Back – End)
function loadDoc() { var xhttp = new XMLHttpRequest(); //Open OOP xhttp.onreadystatechange = function() {// Do Something When result is return if (this.readyState == 4 && this.status == 200) { document.getElementById(“demo”).innerHTML = this.responseText; } }; xhttp.open(“GET”, “ajax_info.txt”, true); xhttp.send(); } //Ajax doing at back end as client , it can changes the front end display […]
OUTPUT BUFFER ob (PHP)
ob_start(); ob_flush(); header(“Location: YOUR LOCATION”); //Work ob_start(‘ob_handler’); ob_flush(); header(“Location: YOUR LOCATION”); //Not Work