function ajaxGet(url, cb){
var req = new XMLHttpRequest();
req.onload = function() {
cb(req.status, req.response);
};
req.open("GET", url);
req.send();
}
ajaxGet('https://httpbin.org/get', function(status, res) {
console.log(status , JSON.parse(res));
})
find
is the common tool for this kind of task:
find ./my_dir -mtime +10 -type f -delete
EXPLANATIONS
./my_dir
your directory (replace with your own)-mtime +10
older than 10 days-type f
only files-delete
no surprise. Remove it to test your find filter before executing the whole command!And take care that ./my_dir
exists to avoid bad surprises!
To achieve this, ssl module has to be enabled and apache needs to be told, how to handle traffic from port 443, this is done by enabling default-ssl site.
$ sudo a2enmod ssl
$ sudo a2ensite default-ssl
$ sudo service apache2 restart
Firewall
If you have firewall enabled, you should allow incoming TCP connection on port 443.
$ sudo ufw allow 443/tcp
Linux's inclination to use the swap, is determined by a setting. The lower the setting number, the more system load is required before your Linux starts using the swap.
On a scale of 0-100, the default setting is 60. Which is much too high for normal desktop use, and only fit for servers. For SSD's, it's just crazy.
A detailed explanation can be found here (link dead? Then download this PDF file with the same content).
Now the how-to:
a. Check your current swappiness setting. Type in the terminal (use copy/paste):
cat /proc/sys/vm/swappiness
Press Enter.
The result will probably be 60
.
b. Now type in the terminal (use copy/paste):
sudo xed /etc/sysctl.conf
Press Enter.
c. Add the following blue lines, at the very end of the existing text in that file (use copy/paste to avoid errors):
# Sharply reduce the inclination to swap
vm.swappiness=1
d. Save the file and close it. -> reboot
Taken from section Limit swap wear in here