How to list current network connection


It’s often needed while installing a server to check the current network connection. Their is a tools in both Windows and Linux OS but the option are quite different.

Here after a sample that list current TCP listening (server side) connection with it’s associated process ID for Linux and Windows OS.


[lolo@dellxps ~]$ netstat -lp --tcp


C:\>netstat -abf -p tcp

To test if a particular port is open (here LDAP 389)


[lolo@dellxps ~]$ netstat -ltnp | grep :389


C:\>netstat -aon | findstr 389

Feel free to use “netstat /?” on windows or the man pages on Linux for more option details.

How to schedule a job/task using crontab


It’s been a long time since my last post. I’ve been quite busy, but i still want to run these pages so here am i.

First thing first, you don’t want to run a job as root (vi /etc/crontab , unless you do exactly what you are doing of course). So all the following instruction are done under my user.

Let’s see what’s on the definition file  “/etc/crontab”

[lolo@dellxps ~]$ cat /etc/crontab

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

See, it already tell you everything you need to know. Let’s take a look to an example. i have created a script(~/scripts/ that will display a notification on my Gnome desktop on Fedora:

#test bash to be launch with crontab or/and anacrontab
#don't forget chmod u+x
notify-send "Hello World" -t 3000

Let now schedule a “funny” reminder every minute ! to edit cron table use the following syntax (to edit another user crontab use -u switch):

[lolo@dellxps ~]$ crontab -e

then add the following line

*/1 * * * * /home/lolo/bin/

Now let set it every working day at 13h05 (1:05 pm) from January to June each year:

5 13 * 1,2,3,4,5,6 mon-fri /home/lolo/bin/

For each value of the time table minute, hour, day of month, month, day of week you can use special character:

  • use * (star) to specify all possible values of the range. ex: use * for day of month position to schedule the task each day of the month.
  • use , (comma) to specify a list of value. ex: to schedule a job every 2 months, at month position set jan,mar,may,jul,sep,nov or 1,3,5,7,9
  • use – (dash) to specify a range of value. ex: to schedule a task from monday to friday set day of week value as 1-5 or mon-fri
  • use / [slash] to specify a recurrence within the unit of time. ex: use * */1 * * * to schedule an event every hour from 00:00 to 24:00

To review the list of tasks scheduled for your current user:

[lolo@dellxps ~]$ crontab -l

To remove/delete all entries:

[lolo@dellxps ~]$ crontab -r

You may also need to use the shortcuts or aliases instead of this long and coding stuff…for instance:

  • @reboot: Run after each time the machine is started.
  • @yearly or @annually: Scheduled once a year, same as “0 0 1 1 *”.
  • @monthly: Run once a month, same as “0 0 1 * *”.
  • @weekly: Scheduled once a week, same as “0 0 * * 0”.
  • @daily or @midnight: Scheduled once a day, same as “0 0 * * *”.
  • @hourly: Scheduled every hour, same as “0 * * * *”.


You can check the cron tab log using the command:

[lolo@dellxps ~]$ tail /var/log/cron

!!! WARNING !!! crontab is used to launch task on a machine that run 24/7. If the the machine is shutdown at the time you specify the task to be executed, NOTHING WILL BE LAUNCH.

If you want to run  a task on a laptop, or desktop that is regulary shutdown use anacrontab instead. It’s similar to crontab but will run the task at {starting time daemon anacron + delay}

[lolo@dellxps ~]$ cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

# the maximal random delay added to the base delay of the jobs
# the jobs will be started during the following hours only

#period in days   delay in minutes   job-identifier   command
1    5    cron.daily        nice run-parts /etc/cron.daily
7    25    cron.weekly        nice run-parts /etc/cron.weekly
@monthly 45    cron.monthly        nice run-parts /etc/cron.monthly

As usual for more detail don’t forget man pages for more help

  • man crontab
  • man anacrontab

Stay tune…

Fedora 18 is out

Fedora 18 is out !

Fedora 18 is out !

Check out it’s new features.

Give it a try and download your favorite distribution.

DuckDuckGo, a quiet search engine


If you are looking for a search engine free of filter, customization or other google stuff but that respect your privacy, give a try to DuckDuckGo.

It’s simple but very efficient

Visite his Microsite to discover its features:

It also have a Android App at Google Play but no IOS version…yet

Browse safe !

10 tips to help you to protect your Android Smartphone


Hacked, lost or stolen, in a daily use never forget that “bad things” happen, and you will never figure it out until it’s happen to you or to a close friend.

Here after 10 actions you can perform RIGHT NOW to make sure your “baby” is more safe.

    1. Keep your Android OS and Apps up-to-date
    2. Encrypt your phone data with a strong password
    3. Do not root your phone
    4. Perform regular backup of the data stored on your device
    5. Disable the option to “Allow installation of non-market apps”
    6. Carefully check the required permissions before install or update an application from the market.
    7. Do not install Flash player on your Android
    8. Never store password in clear text
    9. Disable wireless connection when not used
    10. Install an anti-virus

1-Keep your Android OS and Apps up-to-date
All Operating System evolve, improve their security all the time. Check for system update every month.
Apps also receive update that can protect you from been hacked. Check for update on the market everyday.

2-Encrypt your phone data with a strong password
Forget all programs you can found on the market that let you localized your phone. You loose it ? If your phone is not on silence mode, simply call it’s phone number or use Google Latitude to geo-localized it if you have enable it. Your phone has been stolen ? the first thing the guy will do power it off and remove/throw the sim card away, so don’t waste your money for some apps that will remotely control your phone speaker, send sms with location or anything else …

3-Do not root your phone
Especially if you don’t really know what it’s mean or what’s it’s involves. Root your phone will not “make it faster”. Root your device open “doors” that can be used by hackers to mess with your smartphone.

4-Perform regular backup of the data stored on your device
Once a month is a good start. You can either install one of the backup software (don’t forget to copy generated file to your computer or cloud storage) on the market or manually copy both Internet and external memory storage once connected/mapped to your computer. Also backup your IMEI code (dial *#06# to get it), this code can be useful for some provider to lock your lost or stolen phone.

5-Disable the option to “Allow installation of non-market apps”
Always downloads apps from the google store

6-Carefully check the required permissions before install or update an application from the market.
Ask yourself, why this program would need these permissions ? Good dev provide the answer on the apps description, read it.

7-Do not install ADOBE Flash player on your Android
If you did it already, uninstall it (source  Some fake installer and malware has been found and anyway it’s useless on a smartphone.

8-Never store password in clear text
Yes, i have seen that ! Never use memo, text file, to store your passwords, their is tones of free apps on the market that use high level encryption to store such info on your device.

9-Disable wireless connection when not used
A secure device is an offline device, so simply activate the proper connection(3G/Wifi/BT/NFC) when it’s required, otherwise keep it off  it will improve your battery performance too.

10-Install an anti-virus
Don’t be ashamed because you install an anti-virus , and don’t be convinced of your OS invulnerability, simply be prepared.
Despite the fact that such apps will use lots of resources and drain your battery, installing an anti-virus is never a bad things especially if you spend lot’s of time surfing the web with your mobile or often transfers files from various sources.
Some of them also let you monitor application permission too, and let you choose which permissions to enable and how to activate it.

That’s it, be safe…

Fedora 17 is out !

Fedora 17 is out

Fedora 17 is out

Check what’s new here

How to compress/extract file(s) and folder


While it exist a lot’s of compression program available (some are: arc,arj,bzip2,compress,dact,gzip,lzma,lzop,mscompress,p7Zip,PAQ8HP8,PPMd,rar,rzip,xz,zip,zoo), this post will show the simple way to compress and extract file(s) and folder using natif compression program provide with most distro.

File(s) Compression/Extraction

using bunzip2

bzip2 myfile.ext
compression without deletion:
bzip2 -c myfile.ext > myfile.ext.bz2
bunzip2 myfile.ext.bz2

using gunzip
gzip myfile.ext
compression without deletion:
gzip -c myfile.ext > myfile.ext.gz
gzip -d myfile.ext.gz

Folder Compression/Extraction

compression using bunzip2:
tar -jcvf myfolder.tar.bz2 myfolder
compression using gzip2:
tar -zcvf myfolder.tar.gz myfolder

extraction using bunzip2:
tar -jxvf myfolder.tar.bz2
extraction using gzip2:
tar -zxvf myfolder.tar.gz

note: during extraction, and on this particular example it will create the folder “myfolder” within the current location.

remark on the extension name:
.tar.bz2 can be replaced by .tbz or .tbz2
.tar.gz can be replaced by .tgz

For more detail on the program options don’t forget the man pages