Linux Windows

Openvpn configuration ( debian server & client)

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 […]

Linux

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

Linux

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 […]

CSS

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

Linux Php

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  

javascript Php

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 […]

Back To Top