Archive

Archives pour 05/2015

How to change the MAC address of an Ethernet interface

29/05/2015 Comments off

Change the MAC address of an Ethernet interface temporarily

Check MAC addresses:

$ ifconfig -a | awk '/HWaddr/ {print "Interface: " $1 "\t MAC: " $NF}'
Interface: eth0	 MAC: 08:00:27:2c:a4:69
Interface: eth1	 MAC: 08:00:27:9a:21:24

Shut down desired Ethernet interface (eth0 in this example):

$ sudo ifconfig eth0 down

Specify new MAC address:

$ sudo ifconfig eth0 hw ether 08:00:00:00:00:01

Activate modified Ethernet interface:

# ifconfig eth0 up

Verify changed MAC address:

$ ifconfig -a | awk '/HWaddr/ {print "Interface: " $1 "\t MAC: " $NF}'
Interface: eth0	 MAC: 08:00:00:00:00:01
Interface: eth1	 MAC: 08:00:27:9a:21:24

This change is not permanent as the MAC address on the interface eth0 will revert to the default on next system reboot. Lire la suite…

Categories: Réseau, Système Tags: ,

Clone Your Ubuntu installation

28/05/2015 Comments off

If you want to create a system that is similar to a different system you have already set up, it can be difficult to remember each and every package you had installed.This method works best when you are exporting to and importing from the same distribution and, specifically, the same releasefor example, exporting from Ubuntu Dapper to Ubuntu Dapper or ubuntu edgy to ubuntu edgy.

Ubuntu uses the APT package management system which handles installed packages and their dependencies. If we can get a list of currently installed packages you can very easily duplicate exactly what you have installed now on your new machine. Below is a command you can use to export a list of your installed packages.

sudo dpkg --get-selections | grep '[[:space:]]install$='| awk '{print $1}' > installedpackages
Now you should end up with a file called “installedpackages” which consists of a long list of every package your currently have installed.

The next step would be to tell the clone machine to install each of those packages. You’ll have to copy that file to the clone machine (via network, usb drive, email, etc) and also make sure to duplicate the /etc/apt/sources.list file. Without the same access to repositories it may not be able to find the packages.

To tell your system to use the previously exported package list use the following command (after making sure to also clone your /etc/apt/sources.list file).

Update the source list using the following command

sudo aptitude update

Import the package list using the following command

cat installedpackages | xargs sudo aptitude install

 

Arethusa le test

28/05/2015 Comments off

Un nouveau test VPN publié par le blog du VPN. Ici les VPN sont testés , configurés par créer une base de données la plus fiable possible. Arethusa à ses adeptes, il a déjà été l’ objet d’ une publication par alipaxe. Comme toujours on essayera d’ insister sur les particularités: méthode de configuration – protocole rare – tutos techniques.

Arethusa est proposé par S6N.org: une organisation internationale à but non lucratif fondée en 2003, pour promouvoir liberté d’expression sur Internet. La juridiction dont dépend ce VPN est celle des îles Seychelles: « Applicable jurisdiction for the handling of personal data is the Republic of Seychelles. Only Seychelles authorities can ask us to reveal your personal details. The only details we have about you are the ones you entered yourself. » Le whois de S6N.org confirme l’ enregistrement de nom de domaine de  l’ organisation à Victoria, capitale de cette République. Bien que le site soit en Anglais, le support technique et l’ interface sont en français. Lire la suite…

Categories: Réseau, Sécurité Tags: , , ,

cssh: un outil pour les paresseux…

28/05/2015 Comments off

Cluster ssh

Cluster ssh

Cluster ssh est un outil merveilleux ! Combien de fois ai-je du retaper les mêmes commandes dans deux fenêtres shell différentes sous prétexte que les serveurs faisaient la même chose… Je pense à mes deux serveurs DNS, par exemple.

Évidemment, il faut faire attention à ce qu’on tape car la moindre erreur est reproduite en double… Mais quel bonheur de faire deux fois le travail et surtout d’avoir des configurations identiques quand on le désire.

Autre avantage: si on ouvre plusieurs sessions ssh dans la même commande shell, cssh redimensionne les fenêtres automatiquement.

Attention: si vous ajouter des fenêtres après coup sur Ubuntu, il les superposera sur les précédentes ce qui n’est pas folichon… Il faut prévoir votre nombre de session au départ. Par contre, sur Mac OS X, l’excellent csshX fait le boulot correctement.

Categories: Système Tags: ,

15 Linux Find Command Examples (Part2)

28/05/2015 Comments off

Find Files Based on Access / Modification / Change Time

You can find files based on following three file time attribute.

Access time of the file. Access time gets updated when the file accessed.
Modification time of the file. Modification time gets updated when the file content modified.
Change time of the file. Change time gets updated when the inode data changes. Lire la suite…

Categories: Système Tags: ,

irssi : Startup HOWTO

28/05/2015 Comments off

To new Irssi users (not to new IRC users ..)

Copyright (c) 2000-2002 by Timo Sirainen, release under GNU FDL 1.1 license.

Index with some FAQ questions that are answered in the chapter:

  1. For all the lazy people
    • This window management is just weird, I want it exactly like ircII
  2. Basic user interface usage
    • Split windows work in weird way
    • How can I easily switch between windows?
    • But alt-1 etc. don’t work!
  3. Server and channel automation
    • How do I automatically connect to servers at startup?
    • How do I automatically join to channels at startup?
    • How do I automatically send commands to server at connect?
  4. Setting up windows and automatically restoring them at startup
  5. Status and msgs windows & message levels
    • I want /WHOIS to print reply to current window
    • I want all messages to go to one window, not create new windows
  6. How support for multiple servers works in irssi
    • I connected to some server that doesn’t respond and now irssi keeps trying to reconnect to it again and again, how can I stop it??
    • I want to have own status and/or msgs window for each servers
  7. /LASTLOG and jumping around in scrollback
    • How can I save all texts in a window to file?
  8. Logging
  9. Changing keyboard bindings
    • How do I make F1 key do something?
  10. Proxies and IRC bouncers
    • What’s this irssi-proxy?
  11. Irssi’s settings
  12. Statusbar
    • I loaded a statusbar script but it’s not visible anywhere!

Lire la suite…

Categories: Logiciel, Réseau, Tutoriel Tags: ,

Removing those darn .DS_Store and .AppleDouble directories from shared network storage

28/05/2015 Comments off

.DS_Store

Here is the command to stop the creation of .DS_Store Directories that pollute your network storage resources. For For Mac OS X Lion you need to use:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Now you must Logoff or Restart.

.AppleDouble

To stop the creation of .AppleDouble folders you need to edit your AFP service configuration.  There is usually a « No AppleDouble » or « Enable AppleDouble » configuration setting that needs to be set true (For the NO option) or set to false (For the Enable Option).

Note: In FreeNAS 8.0.4 it seems that the .AppleDouble directories are created anyway regardless of setting.  But at least they seem to be empty and can be removed (rm -r /path/).

The Who, What, and When

The .AppleDouble Directories are used by Mac OS X to store Extended Attributes (exattr) for files residing on filesystems that are not formatted HFS+.  They are most commonly seen when moving a flash drive from your Mac to your Windows Machine.

The .DS_Store Directories store Finder Information.  Such as in « Get File Information » you can access a « Comments » field.  If you provide information on the file i the comment it is stored and Finder Information.  If this directory is missing on remote storage, other Mac users would not be able to see the comment you created.

Why get rid of them?

On network storage you can have the same share presented over AFP (Apple Filing Protocol) andCIFS (Common Internet File System).  Windows users that connect over CIFS can see the extra Apple directories.  The files often copy the name of the original file and prefix it with « ._ ».  Windows users can mistakenly access these files and think their data is corrupt.

Categories: Système Tags: , ,

15 Practical Linux Find Command Examples

28/05/2015 Comments off

Apart from the basic operation of looking for files under a directory structure, you can also perform several practical operations using find command that will make your command line journey easy.

In this article, let us review 15 practical examples of Linux find command that will be very useful to both newbies and experts. Lire la suite…

Categories: Système Tags: ,

15 Examples To Master Linux Command Line History

28/05/2015 Comments off

When you are using Linux command line frequently, using the history effectively can be a major productivity boost. In fact, once you have mastered the 15 examples that I’ve provided here, you’ll find using command line more enjoyable and fun.

1. Display timestamp using HISTTIMEFORMAT

Typically when you type history from command line, it displays the command# and the command. For auditing purpose, it may be beneficial to display the timepstamp along with the command as shown below.

# export HISTTIMEFORMAT='%F %T '
# history | more
1 2008-08-05 19:02:39 service network restart
2 2008-08-05 19:02:39 exit
3 2008-08-05 19:02:39 id
4 2008-08-05 19:02:39 cat /etc/redhat-release

2. Search the history using Control+R

Lire la suite…

Categories: Système Tags: ,

How to Setup Reverse SSH Tunnel on Linux

28/05/2015 Comments off

Reverse SSH is a technique that can be used to access systems (that are behind a firewall) from the outside world.

As you already know SSH is a network protocol that supports cryptographic communication between network nodes. Using this protocol, you can do a secure remote login, secure copy from/to a remote machine etc.

You’ll typically do the following to connect to a remote server securely using ssh command.

$ ssh [your-account-login]@[server-ip]

What is Reverse SSH?

SSH is very good tool to access remote machine or server securely. But, the problem arises when you try to connect to a remote server which is behind a firewall and this firewall denies any incoming connection or data transfer request that has no prior outgoing request. This means that only those connections would be allowed which are initiated by the remote server machine. This is a real problem for those who want to access this server machine remotely. Lire la suite…