Source: nixCraft
How to execute script on the last day of a month on Linux or Unix bash shell? How do I run a disk usage or custom reporting shell/perl/python script on the last day of a month on a Linux or Unix-like systems?
You need to use the date command to find out whether tomorrow is the first day of the next month. If it is true, you can run your script.
Say hello to TZ variable
TZ is time zone environment variable on Linux or Unix-like systems. The TZ environment variable tells functions such as the ctime(3) family and programs like date what the time zone and daylight saving rule is. For example, Greenwich Mean Time can be defined as follows:
TZ='GMT'
You can set TZ as follows to get tomorrow from the current date (+%d):
TZ=GMT-24 date +%d
Lire la suite…
Source: nixCraft
I’m running a process to complete backup and covert images in Mac OS X laptop. I do not wish to disable sleep manually from my OS X power options (Energy Saver). How do I temporarily prevent a Mac from sleeping while my process is still active in Mac OS X Unix operating systems? How can I prevent the system from sleeping temporarily from the command prompt?
You can use the caffeinate command. This command creates assertions to alter system sleep behavior. If no assertion flags are specified, caffeinate creates an assertion to prevent idle sleep.
Another option is to use the pmset command to manipulate power management settings.

Syntax
The syntax is:
caffeinate
caffeinate [options]
caffeinate [options] command
Lire la suite…
1. Testing ICMP:
In this example hping3 will behave like a normal ping utility, sending ICMP-echo und receiving ICMP-reply
hping3 -1 0daysecurity.com
2. Traceroute using ICMP:
This example is similar to famous utilities like tracert (Windows) or traceroute (Linux) who uses ICMP packets increasing every time in 1 its TTL value.
hping3 --traceroute -V -1 0daysecurity.com
3. Checking port:
Here hping3 will send a SYN packet to a specified port (80 in our example). We can control also from which local port will start the scan (5050).
hping3 -V -S -p 80 -s 5050 0daysecurity.com
Lire la suite…
Le URL rewriting (permaliens) sous WordPress nécessite pour la version 2.4 de Apache des paramètres différents de ceux utilisés pour Apache 2.2.
La configuration des fichiers:
- monsite.com.conf
- .htaccess
de votre site Wordpress est spécifique lors du passage à Apache 2.4.
Si vous choisissez /%year%/%monthnum%/%postname%/, il faut préciser le chemin complet dans la configuration du site (monsite.com.conf):
En effet, il faut activer:
<Directory /var/www/dbsysnet/>
Require all granted
Options -Indexes
AllowOverride All
</Directory>
en n’oubliant surtout pas Require all granted et surtout le « / » à la fin du chemin vers le dossier racine.
Sinon tous les permaliens amèneront à une page « Not found » et même pas celle que vous avez défini pour les erreurs 404 dans votre .htaccess.
Voilà. Ça m’a pris plus de deux heures (si Julien n’avait pas été là, on aurait retrouvé mon cadavre au bout d’une branche…).
Source: nixCraft
Two factor authentication is increasingly becoming a strongly recommended way of protecting user accounts in web applications from attackers by requiring a second method of authentication in addition to the standard username and password pair.
Although two factor authentication can encompass a wide range of techniques like biometrics or smart cards, the most commonly deployed technique in web applications is the one time password. If you have used applications like Gmail, you are probably familiar with the one time password generated by the Google Authenticator app that’s available on iOS or Android devices.
The algorithm used for the one time password in the Google Authenticator app is known as the Time-based One-Time Password (TOTP) algorithm. The TOTP algorithm is a standard algorithm approved by the IETF in (RFC 6238) totp-rfc.
Lire la suite…