Affichage des articles dont le libellé est 4. Afficher tous les articles
Affichage des articles dont le libellé est 4. Afficher tous les articles

vendredi 29 juin 2012

How to install nTOP 4 on CentOS 6 by RPM

nTOP is a Network Tap program. It displays a summary of network usage by machines on your network in a format reminiscent of the unix top utility. It can also be run in web mode, which allows the display to be browsed with a web browser.
1. Install RPMforge repo :
# rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
Note : you can find the lastest of rpmforge repo at http://pkgs.repoforge.org/rpmforge-release
2. Install necessary packages for nTOP :
# yum install graphviz rrdtool rrdtool-devel geoip geoip-devel net-snmp-libs gdbm gdbm-devel
3. Install nTOP :
# cd /usr/src
# wget http://dl.marmotte.net/rpms/redhat/el6/x86_64/ntop-4.0.3-1.el6/ntop-4.0.3-1.el6.x86_64.rpm
# rpm -ivh ntop-4.0.3-1.el6.x86_64.rpm
# chkconfig ntop on
4. Set Admin password :
# ntop -A
5. Start nTOP service :
# service ntop start
6. Confirm nTOP is working :
# lsof -i :3000
# lsof -i :3001
Note : TCP 3000 for HTTP and TCP 3001 for HTTPs
7. Secure ntop access from outside :
a. Browse to https://ip-address.your.nTOP.server:3001
b. Click “Admin” > “Configure” > “Protect URLs”
c. Enter username “admin” and your password (set in step 4 above) when prompted.
d. Click “Add URL” then “Add URL” again.
NOTE: This will require a username and password to access https://ip-address.your.nTOP.server:3001

source  :  http://saroot.org/blog/how-to-install-ntop-4-on-centos-6-by-rmp-package/

mercredi 19 octobre 2011

Change timezone on CentOS - RedHat - Fedora

For exemple, for Paris :

cp /usr/share/zoneinfo/Europe/Paris /etc/localtime

Enjoy :)

jeudi 13 octobre 2011

Hum un nouveau lan, qu'est ce qui se passe par là ?

1) Nmap

nmap -v -sP 192.168.240.0/24 | grep -v "appears to be down" | grep Host

vendredi 7 octobre 2011

Recevoir un mail à chaque connexion ssh

Pour certains serveurs, il peut s'avérer pratique de savoir qui se connecte en ssh.



A l'aide du script suivant à ajouter au fichier  /etc/ssh/sshrc, il est possible de recevoir un mail à chaque connexion.

#!/bin/sh
DATE=`date "+%d-%m-%Y %H:%M"`
IP=`echo $SSH_CONNECTION | awk '{print $1}'`
REVERSE=`dig -x $IP +short`
 
# Message + envoi du mail
echo "USER : $USER
IP : $IP
ReverseDNS : $REVERSE
Date : $DATE
 
" | mail -s "[SSH] $DATE - Connexion de $USER" your_email@domaine.com

Source 

mercredi 5 octobre 2011

Connection ssh trop lente "An invalid name was supplied"


Sous ubuntu 10.04 et autre distribution le client ssh est configuré par défaut avec l'option  GSSAPIAuthentication = yes

Ce qui implique sur certains LAN où le DNS est mal configuré (la résolution inverse) un temps de connexion d'environ 10s.

ssh -v user@host
debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied


debug2: we did not send a packet, disable method

Il est possible de ne plus avoir ce message en passant l'option GSSAPIAuthentication à no. Modification possible dans le fichier de configuration /etc/ssh/ssh_config ou via l'option -o GSSAPIAuthentication=no en mode ligne de commande.

Source : http://onlyubuntu.blogspot.com/2007/04/fix-for-ssh-slow-to-ask-for-password-in.html

A noter qu'une autre explication est proposé sur ce site.

Un peu de détail sur ce qu'est GSSAPI

mardi 27 septembre 2011

Forcer le mode red/write sur pour un disque NTFS

Parfois, même si la commande mount nous affiche un filesystem NTFS en rw....bah ça marche.

Pour s'en dépatouiller, ntfs-3g /dev/sda1 /mnt/usb1/ -o force,rw

vendredi 23 septembre 2011

How to conver VMDK VirtualBox VM to VMware Esxi 4.1 Server

Après plusieurs tentatives, le plus simple fut d'utiliser l'outils VBoxManage.exe avec l'option clonehd.

Se positionner dans le répertoire d’installation de VirtualBox (par défaut : ‘C:\Program Files\Oracle\VirtualBox\.

VBoxManage.exe clonehd <chemin complet du fichier source> <chemin complet du fichier de destination> — format VMDK –variant Standard


Copier le fichier dans le datastore de Esxi.
Créer une nouvelle machine en utilisant un disque existant (le disque créé précédemment).

Lancer la machine !

Bonheur, ça fonctionne.



mardi 20 septembre 2011

Y'a quoi dans mon pcap

Parfois, un éditeur hexadécimal  pour fouiller dans un fichier data (raw) qui provient d'un pcap ça fait mal à la tête.
York est passé par là. A noter qu'il est possible de faire directement des captures avec ce logiciel.

Quelques précisons, in english :


York::Log all network traffic
Description:
  • Log source, destination [fqdn or ip address] and packet size of all network traffic on your network, of course also outbound traffic. The network card will be set into promiscuous mode.
  • Save sniffed HTTP and FTP files. Just for fun, pictures are shown in a slideshow and in a screensaver like window.
  • Sniff for HTTP, FTP, POP3, SMTP, SMB, VNC and AIM password/hash and HTTP cookies like 'GX'.
  • Select a client and follow his clicks in your browser. [WebSession]
  • Screensaver included. Shows sniffed pictures in a slideshow.
  • For advanced user: You can capture traffic into a pcap file, send a pcap file and replay a pcap file.
  • For advanced user: You can restrict captured traffic by tcpdump filters.
Please note, WinPcap [www.winpcap.org] is used to get the network traffic. The Setup will install WinPcap automatically.
The columns in the log file are tabulator separated for easy import into Excel or so.
One line in the log file looks like this:
19.08.2003 02:49 [0:01:03] theszdbg <-> www.traffichome.com http 55 kByte 56329 Bytes
If your need more or other information in the logfile or have feature requests, please send me an mail.












Active connections and their data volume:
Sniffed HTTP and FTP files:
Sniffed HTTP, FTP, POP3, SMTP, SMB, VNC and AIM passwords/hash's:
Slideshow of sniffed HTTP and FTP pictures:




Source : http://thesz.diecru.eu/content/york.php

vendredi 10 juin 2011

Dnsmasq : DNS (cache) / DHCP & TFTP

Dnsmasq est un serveur DHCP et DNS à faible empreinte mémoire. Il offre à la fois les services DNS, DHCP et TFTP pour un réseau local (LAN).

Dnsmasq accepte les requêtes DNS et y réponds soit en utilisant un petit cache local, soit en effectuant une requête à un serveur DNS récursif externe (par exemple celui de votre fournisseur d'accès internet). Il charge le contenu du fichier /etc/hosts afin que les noms locaux n'apparaissant pas dans les DNS globaux soient tout de même résolus, et assure également la résolution de nom pour les hôtes présents dans le service DHCP.

Le serveur DHCP Dnsmasq DHCP supporte les définitions d'adresses statiques et les réseaux multiples. Il envoie par défaut un jeu raisonnable de paramètres DHCP, et peut être configuré pour envoyer n'importe quel option DHCP. Il inclut un serveur TFTP sécurisé en lecture seule permettant le démarrage via le réseau/PXE de clients DHCP et supporte également le protocole BOOTP.

Ce logiciel est disponible pour la majeur partie des distributions linux via yum/apt ou autres.

Dnsmasq supporte IPv6 pour le DNS et TFTP mais pas pour le DHCP

Exemple de configuration :

# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.

# The following two options make you a better netizen, since they
# tell dnsmasq to filter out queries which the public DNS cannot
# answer, and which load the servers (especially the root servers)
# uneccessarily. If you have a dial-on-demand link they also stop
# these requests from bringing up the link uneccessarily.

# Never forward plain names (without a dot or domain part)
domain-needed
# Never forward addresses in the non-routed address spaces.
bogus-priv


# Uncomment this to filter useless windows-originated DNS requests
# which can trigger dial-on-demand links needlessly.
# Note that (amongst other things) this blocks all SRV requests,
# so don't use it if you use eg Kerberos.
# This option only affects forwarding, SRV records originating for
# dnsmasq (via srv-host= lines) are not suppressed by it.
#filterwin2k

# Change this line if you want dns to get its upstream servers from
# somewhere other that /etc/resolv.conf
#resolv-file=
resolv-file=/etc/dnsmasqupstreamservers

# By default, dnsmasq will send queries to any of the upstream
# servers it knows about and tries to favour servers to are known
# to be up. Uncommenting this forces dnsmasq to try each query
# with each server strictly in the order they appear in
# /etc/resolv.conf
#strict-order

# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers from this file instead (see below), then
# uncomment this
#no-resolv

# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
# files for changes and re-read them then uncomment this.
#no-poll

# Add other name servers here, with domain specs if they are for
# non-public domains.
#server=/localnet/192.168.0.1
#server=166.70.63.3

# Add local-only domains here, queries in these domains are answered
# from /etc/hosts or DHCP only.
#local=/localnet/

# Add domains which you want to force to an IP address here.
# The example below send any host in doubleclick.net to a local
# webserver.
#address=/doubleclick.net/127.0.0.1

# If you want dnsmasq to change uid and gid to something other
# than the default, edit the following lines.
#user=
#group=

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
#interface=
# Or you can specify which interface _not_ to listen on
#except-interface=
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
#listen-address=
# If you want dnsmasq to provide only DNS service on an interface,
# configure it as shown above, and then use the following line to
# disable DHCP on it.
#no-dhcp-interface=

# On systems which support it, dnsmasq binds the wildcard address,
# even when it is listening on only some interfaces. It then discards
# requests that it shouldn't reply to. This has the advantage of
# working even when interfaces come and go and change address. If you
# want dnsmasq to really bind only the interfaces it is listening on,
# uncomment this option. About the only time you may need this is when
# running another nameserver on the same machine.
#bind-interfaces

# If you don't want dnsmasq to read /etc/hosts, uncomment the
# following line.
#no-hosts
# or if you want it to read another file, as well as /etc/hosts, use
# this.
#addn-hosts=/etc/banner_add_hosts
addn-hosts=/etc/dnsmasqhosts

# Set this (and domain: see below) if you want to have a domain
# automatically added to simple names in a hosts-file.
#expand-hosts

# Set the domain for dnsmasq. this is optional, but if it is set, it
# does the following things.
# 1) Allows DHCP hosts to have fully qualified domain names, as long
# as the domain part matches this setting.
# 2) Sets the "domain" DHCP option thereby potentially setting the
# domain of all systems configured by DHCP
# 3) Provides the domain part for "expand-hosts"
#domain=thekelleys.org.uk

# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
dhcp-range=192.168.0.50,192.168.0.150,12h

# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h

# This is an example of a DHCP range with a network-id, so that
# some DHCP options may be set only for this network.
#dhcp-range=red,192.168.0.50,192.168.0.150

# Supply parameters for specified hosts using DHCP. There are lots
# of valid alternatives, so we will give examples of each. Note that
# IP addresses DO NOT have to be in the range given above, they just
# need to be on the same network. The order of the parameters in these
# do not matter, it's permissble to give name,adddress and MAC in any order

# Always allocate the host with ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60
#dhcp-host=11:22:33:44:55:66,192.168.0.60

# Always set the name of the host with hardware address
# 11:22:33:44:55:66 to be "fred"
#dhcp-host=11:22:33:44:55:66,fred

# Always give the host with ethernet address 11:22:33:44:55:66
# the name fred and IP address 192.168.0.60 and lease time 45 minutes
#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
dhcp-host=00:0e:2e:0d:44:be,Bunsen,192.168.0.106

# Give the machine which says it's name is "bert" IP address
# 192.168.0.70 and an infinite lease
#dhcp-host=bert,192.168.0.70,infinite

# Always give the host with client identifier 01:02:02:04
# the IP address 192.168.0.60
#dhcp-host=id:01:02:02:04,192.168.0.60

# Always give the host with client identifier "marjorie"
# the IP address 192.168.0.60
#dhcp-host=id:marjorie,192.168.0.60

# Enable the address given for "judge" in /etc/hosts
# to be given to a machine presenting the name "judge" when
# it asks for a DHCP lease.
#dhcp-host=judge

# Never offer DHCP service to a machine whose ethernet
# address is 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,ignore

# Ignore any client-id presented by the machine with ethernet
# address 11:22:33:44:55:66. This is useful to prevent a machine
# being treated differently when running under different OS's or
# between PXE boot and OS boot.
#dhcp-host=11:22:33:44:55:66,id:*

# Send extra options which are tagged as "red" to
# the machine with ethernet address 11:22:33:44:55:66
#dhcp-host=11:22:33:44:55:66,net:red

# Send extra options which are tagged as "red" to
# any machine with ethernet address starting 11:22:33:
#dhcp-host=11:22:33:*:*:*,net:red

# Send extra options which are tagged as "red" to any machine whose
# DHCP vendorclass string includes the substring "Linux"
#dhcp-vendorclass=red,Linux

# Send extra options which are tagged as "red" to any machine one
# of whose DHCP userclass strings includes the substring "accounts"
#dhcp-userclass=red,accounts

# If this line is uncommented, dnsmasq will read /etc/ethers and act
# on the ethernet-address/IP pairs found there just as if they had
# been given as --dhcp-host options. Useful if you keep
# MAC-address/host mappings there for other purposes.
#read-ethers

# Send options to hosts which ask for a DHCP lease.
# See RFC 2132 for details of available options.
# Note that all the common settings, such as netmask and
# broadcast address, DNS server and default route, are given
# sane defaults by dnsmasq. You very likely will not need any
# any dhcp-options. If you use Windows clients and Samba, there
# are some options which are recommended, they are detailed at the
# end of this section.
# For reference, the common options are:
# subnet mask - 1
# default router - 3
# DNS server - 6
# broadcast address - 28

# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
#dhcp-option=42,192.168.0.4,10.10.0.5
dhcp-option=3,192.168.0.1

# Set the NTP time server address to be the same machine as
# is running dnsmasq
#dhcp-option=42,0.0.0.0

# Set the NIS domain name to "welly"
#dhcp-option=40,welly

# Set the default time-to-live to 50
#dhcp-option=23,50

# Set the "all subnets are local" flag
#dhcp-option=27,1

# Send the etherboot magic flag and then etherboot options (a string).
#dhcp-option=128,e4:45:74:68:00:00
#dhcp-option=129,NIC=eepro100

# Specify an option which will only be sent to the "red" network
# (see dhcp-range for the declaration of the "red" network)
#dhcp-option=red,42,192.168.1.1

# The following DHCP options set up dnsmasq in the same way as is specified
# for the ISC dhcpcd in
# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
# adapted for a typical dnsmasq installation where the host running
# dnsmasq is also the host running samba.
# you may want to uncomment them if you use Windows clients and Samba.
#dhcp-option=19,0 # option ip-forwarding off
#dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
#dhcp-option=45,0.0.0.0 # netbios datagram distribution server
#dhcp-option=46,8 # netbios node type
#dhcp-option=47 # empty netbios scope.

# Send RFC-3397 DNS domain search DHCP option. WARNING: Your DHCP client
# probably doesn't support this......
#dhcp-option=119,eng.apple.com,marketing.apple.com

# Send encapsulated vendor-class specific options. The vendor-class
# is sent as DHCP option 60, and all the options marked with the
# vendor class are send encapsulated in DHCP option 43. The meaning of
# the options is defined by the vendor-class. This example sets the
# mtftp address to 0.0.0.0 for PXEClients
#dhcp-option=vendor:PXEClient,1,0.0.0.0

# Set the boot filename and tftpd server name and address
# for BOOTP. You will only need this is you want to
# boot machines over the network.
#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3

# Set the limit on DHCP leases, the default is 150
#dhcp-lease-max=150

# The DHCP server needs somewhere on disk to keep its lease database.
# This defaults to a sane location, but if you want to change it, use
# the line below.
#dhcp-leasefile=/var/lib/misc/dnsmasq.leases

# Set the DHCP server to authoritative mode. In this mode it will barge in
# and take over the lease for any client which broadcasts on the network,
# whether it has a record of the lease or not. This avoids long timeouts
# when a machine wakes up on a new network. DO NOT enable this if there's
# the slighest chance that you might end up accidentally configuring a DHCP
# server for your campus/company accidentally. The ISC server uses the same
# the same option, and this URL provides more information:
# http://www.isc.org/index.pl?/sw/dhcp/authoritative.php
#dhcp-authoritative

# Set the cachesize here.
#cache-size=150

# If you want to disable negative caching, uncomment this.
#no-negcache

# Normally responses which come form /etc/hosts and the DHCP lease
# file have Time-To-Live set as zero, which conventionally means
# do not cache further. If you are happy to trade lower load on the
# server for potentially stale date, you can set a time-to-live (in
# seconds) here.
#local-ttl=

# If you want dnsmasq to detect attempts by Verisign to send queries
# to unregistered .com and .net hosts to its sitefinder service and
# have dnsmasq instead return the correct NXDOMAIN response, uncomment
# this line. You can add similar lines to do the same for other
# registries which have implemented wildcard A records.
#bogus-nxdomain=64.94.110.11

# If you want to fix up DNS results from upstream servers, use the
# alias option. This only works for IPv4.
# This alias makes a result of 1.2.3.4 appear as 5.6.7.8
#alias=1.2.3.4,5.6.7.8
# and this maps 1.2.3.x to 5.6.7.x
#alias=1.2.3.0,5.6.7.0,255.255.255.0


# Change these lines if you want dnsmasq to serve MX records.

# Return an MX record named "maildomain.com" with target
# servermachine.com and preference 50
#mx-host=maildomain.com,servermachine.com,50

# Set the default target for MX records created using the localmx option.
#mx-target=servermachine.com

# Return an MX record pointing to the mx-target for all local
# machines.
#localmx

# Return an MX record pointing to itself for all local machines.
#selfmx

# Change the following lines if you want dnsmasq to serve SRV
# records. These are useful if you want to serve ldap requests for
# Active Directory and other windows-originated DNS requests.
# See RFC 2782.
# You may add multiple srv-host lines.
# The fields are ,,,,
# If the domain part if missing from the name (so that is just has the
# service and protocol sections) then the domain given by the domain=
# config option is used. (Note that expand-hosts does not need to be
# set for this to work.)

# A SRV record sending LDAP for the example.com domain to
# ldapserver.example.com port 289
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389

# A SRV record sending LDAP for the example.com domain to
# ldapserver.example.com port 289 (using domain=)
#domain=example.com
#srv-host=_ldap._tcp,ldapserver.example.com,389

# Two SRV records for LDAP, each with different priorities
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2

# A SRV record indicating that there is no LDAP server for the domain
# example.com
#srv-host=_ldap._tcp.example.com


# Change the following lines to enable dnsmasq to serve TXT records.
# These are used for things like SPF and zeroconf. (Note that the
# domain-name expansion done for SRV records _does_not
# occur for TXT records.)

#Example SPF.
#txt-record=example.com,v=spf1 a -all

#Example zeroconf
#txt-record=_http._tcp.example.com,name=value,paper=A4


# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
#log-queries

# Include a another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf

jeudi 21 avril 2011

Pas de clic droit avec mon touchpad sous ubuntu

Support the for clickpad on Ubuntu is still a bit flaky. Not only are advanced features like enhanced gesture support and multitouch not available out of the box on Ubuntu. Other basic features like right clicking, horizontal scrolling, click and drag etc can be quite a hassle. On Ubuntu 10.04 some of the basic features have been fixed (although multitouch support is still lacking).

Same thing can not be said of Ubuntu 10.10 because there was a regression which make it impossible to right click using the touchpad. Already a bug has been filled concerning the issue which should hopefully be fixed during the Maverick release circle.

Walk Around

The Good news is there is a walk around this issue for those who won’t mind getting their hands dirty with messing around with the command-line. The walk around involves using a psmouse patch submitted by Paul which fixes the issue. (At least for me)

For this walk around some packages would have to be installed namely the build-essential package and the dkms packages. Build-essentials helps install basic tools needed for compiling packages from source, while the dkms ”is a framework designed to allow individual kernel modules to be upgraded without changing the whole kernel. It is also very easy to rebuild modules as you upgrade kernels. framework designed to allow individual kernel modules to be upgraded without changing the whole kernel. It is also very easy to rebuild modules as you upgrade kernels.” which in English means whatever module we patch would not need to be repatched should the system’s kernel be upgraded. (At least that’s the idea)

sudo apt-get install dkms build-essential

The fix involves patching the psmouse module using the paul’s archive which is the mouse source directory for linux 2.6.35-22-generic (The version of Linux Kernal which shipped with Ubuntu 10.10 as at blog time)

First download the archive file from here

save the downloaded file to your desktop

Open a terminal (Application/Accessories/Terminal – Kubuntu users should go /System/Konsole)



Move to the Directory where the archive was saved (In this case the desktop) and extract the content of the archive

cd $HOME/Desktop && tar xvf psmouse-2.6.35-22-generic-patched.tar.bz2.tar

The name of the package as changed since writing this post the new command which reflects the change is

cd $HOME/Desktop && tar jxvf psmouse-2.6.35-22-generic-patched.tar.bz2

Move the extracted folder to /usr/src which is under the root directory hence the command would have to be executed with sudo

sudo mv psmouse-2.6.35-22-generic /usr/src

Move into the /usr/src directory

cd /usr/src

Then install the psmouse module with the following commands running them one after the other

sudo dkms add -m psmouse -v 2.6.35-22-generic

sudo dkms build -m psmouse -v 2.6.35-22-generic

sudo dkms install -m psmouse -v 2.6.35-22-generic

Once installed reboot for the module to be loaded.

If you are still having issues with right clicks. This command would help check if the psmodule is installed

sudo dkms status -m psmouse -v 2.6.35-22-generic

The output should be something like this

psmouse, 2.6.35-22-generic, 2.6.35-22-generic, i686: installed

If it is not installed. It can always be rebuilt with the following command

sudo dkms build -m psmouse -v 2.6.35-22-generic

sudo dkms install -m psmouse -v 2.6.35-22-generic

In case you followed this guide and it did not work for you, or Ubuntu releases an official fix for the issue (in which case you would have to remove the changes made following this guide to prevent conflicts) or for some reason you would like to revert the changes made following this guide. simply do

sudo dkms uninstall -m psmouse -v 2.6.35-22-generic

sudo dkms remove -m psmouse -v 2.6.35-22-generic --all

Following this guide does not lead to the nirvana of clickpad awesomeness (at least not for me). There are still some issues with Jumpy mouse which also affect windows 7. However it does make the clickpad much more useful under Ubuntu even then I would suggest that for serious work it won’t hurt to have a mouse handy :D

NB You can track the bug concerning this issue here

Thanks to Paul and Tob who really helped with the patch which fixes this issue.

I hope someone finds this useful.

vendredi 25 février 2011

Dead Drops


‘Dead Drops’ is an anonymous, offline, peer to peer file-sharing network in public space. USB flash drives are embedded into walls, buildings and curbs accessable to anybody in public space. Everyone is invited to drop or find files on a dead drop. Plug your laptop to a wall, house or pole to share your favorite files and data. Each dead drop is installed empty except a readme.txt file explaining the project. ‘Dead Drops’ is open to participation. If you want to install a dead drop in your city/neighborhood follow the ‘how to’ instructions and submit the location and pictures.

jeudi 24 février 2011

Votre Linux est-il vraiment libre ?



Vous souhaitez savoir si votre Système GNU/Linux est libre ?
Et si ce n’est pas le cas comment faire pour le rendre libre ?
VRMS (Virtual Richard Matthew Stallman ) se charge de ça
Pour l’installer rien de plus simple (en root) :
# apt-get install vrms
Ensuite on le lance dans un terminal (oui pas d’interface graphique) :
# vrms
Et tout de suite les statistiques apparaissent.

Lubuntu ou la distrub linux graphique legère

Lubuntu est une variante d'Ubuntu dont l'environnement de bureau est LXDE (tout comme Kubuntu et Xubuntu qui ont pour environnement de bureau respectivement KDE et Xfce).

Quelques infos sur wikipedia

Voici un comparatif d'utilisattion mémoire en live CD :
  • Lubuntu : 57,908 KB
  • Xubuntu : 156,852 KB
  • Ubuntu : 153,840 KB
Même si il est possible d'installer tous les logiciels disponibles pour Ubuntu, Lubuntu choisit les plus légers :
  • Google Chrome : Le navigateur Web (je préfère Midori)
  • Claws Mail : Le client Mail que j'utilise
  • Gpicview : Visionneur d'images
  • MTpaint : Retouche d'images (beaucoup plus rapide que Gimp)
  • Aqualung : Lecteur audio
  • SMPlayer : Lecteur vidéo
  • Abiword : Le traitement de texte poids plume (mais efficace)

mercredi 23 février 2011

Acer Liquid - Recovery

Recovery :
=======

1. eteindre le téléphone
2. appuyer sur camera + volume down et sans relacher appuyer sur power
3. Le telephone vibre alors 2 fois
4. relachez les boutons
3. Appuyer sur power.

15 Useful Android Terminal (ADB Shell) Commands

While rooting your Android Phone or installing custom ROM on your mobile or partitioning your android device to install applications, requires some android terminal command and ADB (Android Debug Bridge) shell command knowledge. Below is the list of some basic android commands that are being used on Android platform frequently and that every android user must know.
android adb shell
Basic Android Terminal and ADB Shell Command List

1. How to open a cmd in Android Phone

Method 1: “Start” – “”Program”-” “Accessories” – “” Command Prompt ”
Method 2: “Start” – “” Run “, type cmd ENTER

2. How to restart Android Phone
When the phone and Computer is connected to the data cable, you can enter the following command

adb shell reboot === ENTER

3. Restart Android into Recovery Mode
With the data cable connected to your phone and computer, enter the following command

adb shell reboot recovery === ENTER

4. Convert back to ext2 partition
Restart the phone into Recovery mode, press “Alt + X” into the console. Open cmd and enter the following command

1 adb shell === ENTER
2 tune2fs-O ^ has_journal / dev/block/mmcblk0p2 === carriage return
3 e2fsck / dev/block/mmcblk0p2 === carriage return (optional, can be a problem area in section 2, when used)

5. Pulling applications from Android phone to computer

adb pull /system/sd/app app
adb pull /system/sd/app-private app-private

6. Pushing applications back to android phone from the computer

adb push app /system/sd/app
adb push app-private /system/sd/app-private

7. Delete existing apps on Android SD

adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private

8. Repair gravity System or switch to screen
Sometimes frequent brushing of phone can cause gravity system or switch to screen failure. Just follow the steps below-
Restart the phone into Recovery mode, press “Alt + X” into the console
Open cmd and enter the following command

mount / data === carriage return
rm / data / misc / akmd * / data / misc / rild * === ENTER

9. Ext2/ext3/ext4 formatted partition
Enter the following command in the cmd

adb remount === ENTER
adb shell === ENTER
rm-r / system / sd / * === carriage return

10. Remove/ system / app under the application

Under normal circumstances / system / app is not under an application. Use the following methods to remove these applications.
Open cmd and enter the following command

adb remount === ENTER
adb rm / system / app / Stocks.apk === Enter

11. If the start Time is too Long
Just enter the following command in order to view the boot process.

adb logcat === ENTER

12. Through Terminal Partition SD card
It will erase everything on your SD card

$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)

13. From the Recovery Screen, send an update file to your SD card.

adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip

14. Restoring a nandroid backup via Fastboot
Start command-prompt/terminal cd to the nandroid folder and enter following commands

fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot

15. Clear Search History in Android

Search History is accounted for Mobile Memory. It can also leak your privacy information as well. Just follow the steps below to clear android history.

Steps are as follows:

1. Make sure your mobile phone has Root authority.
2. Open the super-terminal.
3. Enter the following command

su
rm / data / data / com.android.vending / databases / suggestions.db

4. Exit Hyper Terminal and restart the phone.

Source : http://www.gadgetsdna.com/android-terminal-adb-shell-command-list/1168/

vendredi 11 février 2011

Extraire une page d'un fichier .ps ou .pdf

Pour les pdf en installant "pdftk" (très pratique au passage), on peut faire ça.

Par exemple pour extraire les pages 2 à 5 et 23 à 45 d'un pdf (bash.fr) vers un nouveau document (test.pdf) :
pdftk bash.pdf cat 2-5 23-45 output test.pdf

lundi 7 février 2011

Afficher les informations des Intel Core i3, i5 et i7 sous Linux



i7z est un utilitaire pour Linux qui permet d'obtenir des informations sur les processeurs Intel Core i3, i5 et i7. On pourra ainsi vérifier le bon fonctionnement du mode Turbo (une technologie propre à ce modèle de CPU), ou afficher la fréquence d'utilisation de chacun des coeurs.

i7z
Pour installer i7z, ouvrez un terminal en root et lancez la commande suivante pour une distribution à base de Debian :
sudo apt-get install build-essential libqt4-dev qt4-qmake libncurses5-dev subversion
Ou celle-ci pour une distribution à base de RPM :
yum install qt qt4-devel libncurses5-devel subversion
Ensuite, on pourra compiler le programme comme ceci :
svn checkout http://i7z.googlecode.com/svn/trunk/ i7z-read-only
cd i7z-read-only
make
make install
Vous pourrez ensuite lancer le programme avec la commande i7z, en root, depuis une console. Le message suivant indiquera que le mode Turbo est désactivé (il faudra alors revoir les réglages de votre Bios) :
TURBO DISABLED on 4 Cores
Tandis que celui-ci confirmera son bon fonctionnement :
TURBO ENABLED on 4 Cores
Voici ce que j'obtiens chez moi, après avoir lancé un cat /dev/urandom > /dev/null dans un autre shell. Ici, on voit bien que le mode Turbo est actif avec des Multiplier à x22 sur les quatre coeurs du processeur :
Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
  TURBO ENABLED on 4 Cores, Hyper Threading ON
  True Frequency 3075.73 MHz (133.73 x [23])
  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  27x/26x/24x/24x
  Current Frequency 2942.09 MHz (Max of below)
        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %
        Core 1 [0]:       2942.01 (22.00x)      3.38    0.923      0    95.7
        Core 2 [1]:       2942.00 (22.00x)       100       0       0       0
        Core 3 [2]:       2942.09 (22.00x)      2.52    1.53       0    95.9
        Core 4 [3]:       2940.99 (21.99x)         1    1.63       0    97.6
Si vous souhaitez utiliser l'interface graphique, il faudra se rendre dans le dossier GUI des sources et lancer la compilation comme ceci :
cd GUI
make clean
rm Makefile
qmake-qt4 -project
qmake-qt4
make
./GUI

Accélérer Firefox par la Ram sans TmpF

Précédemment j’utilisais TmpFS afin de déplacer  le cache de Firefox (Iceweasel sous debian) dans la mémoire vive (RAM). Le but principal étant d’accélérer le temps de chargement des pages vu que la RAM est plus rapide que le disque dur et, également de diminuer l’usure d’un SSD.
Hors, il existe une option dans Firefox pour utiliser le cache dans la mémoire vive, pour cela :
  1. Entrer « about:config » dans la barre d’adresse puis valider.
  2. Taper le mot clef « browser.cache » dans le champ de recherche.
  3. Passer la valeur « browser.cache.disk.enable » à « false ».
  4. Regarder que la valeur « browser.cache.memory.enable » est à « true ».
  5. Créer une nouvelle valeur numérique au nom « browser.cache.memory.capacity » ayant pour valeur « -1 » (taille dynamique).
  6. Redémarrer Firefox, Enjoy ^^.
Voilà, bonne année :D

Tuto pour avoir un joli boot-loader graphique

Par défaut GRUB est loin d’être élégant et sont interface fait vraiment peut moderne, mais il y a une façon de remédier à cela en utilisant BURG qui est un chargeur d’amorçage tout nouveau basé sur GRUB.
BURG est compatible avec plus de systèmes d’exploitations et dispose d’un système de menus hautement configurable qui travaille en mode texte et graphique.
ATTENTION : N’essayez pas ceci à moins de savoir vraiment ce que vous faites. Cette manipulation peut-être dangereuse pour votre système car il pourrait ne plus démarrer. Je ne fais que traduire cette source, je ne suis en aucun cas responsable de vos dégâts.
Ajouter le dépôt et le logiciel :
sudo add-apt-repository ppa:bean123ch/burg
sudo apt-get update && sudo apt-get install burg burg-themes
Réponder au questions durant l’installation des paquets, pour être sûr taper quand même cette commande à adapter selon votre MBR :
sudo burg-install « (hd0) » 
Mettre à jour le nouveau chargeur de démarrage (ça doit absolument marcher, sinon ne redémarrer plus…) :
sudo update-burg
Si tout c’est bien passé au démarrage vous aurez un joli thème que vous pourrez choisir en pressant la touche « t ».  Ou sinon vous pouvez visualiser directement les thèmes en tapant la commande « burg-emu » dans un terminal (presser la touche « c » puis taper « exit » pour quitter).


sources :
http://hackurx.wordpress.com/2010/06/21/tuto-pour-avoir-un-joli-boot-loader-graphique/
http://www.tux-planet.fr/ameliorez-votre-grub-avec-burg/
http://forum.ubuntu-fr.org/viewtopic.php?id=381017


vendredi 4 février 2011

Admin Setup Process / CentOS 64 bits

Configuration

Updated System

  • Configured Yum Priorities & to use our mirror
    • Edited /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirror.clarkson.edu/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
exclude=nmap

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.clarkson.edu/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirror.clarkson.edu/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirror.clarkson.edu/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirror.clarkson.edu/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirror.clarkson.edu/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
    • Edited /etc/yum.repos.d/rpmforge.repo
# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://mirror.clarkson.edu/rpmforge/redhat/el5/en/$basearch/dag
#mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=15
    • Edited /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
baseurl=http://mirror.clarkson.edu/epel/5/$basearch
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
priority=30

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
baseurl=http://mirror.clarkson.edu/epel/5/$basearch/debug
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=30

[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
baseurl=http://mirror.clarkson.edu/epel/5/SRPMS
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=30
    • Edited /etc/yum.repos.d/epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch
baseurl=http://mirror.clarkson.edu/epel/testing/5/$basearch
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
priority=40

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug
baseurl=http://mirror.clarkson.edu/epel/testing/5/$basearch/debug
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-debug-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=40

[epel-testing-source]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source
baseurl=http://mirror.clarkson.edu/epel/testing/5/SRPMS
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-source-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=1
priority=40
  • Disabled Yum FastestMirror since using local mirror
    • sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
  • Installed Yum Priorities (Note: This must be installed prior to installing the packages below.)
    • yum install yum-priorities
  • Configured Yum Priorities to check for obsoletes
    • echo "check_obsoletes=1" >> /etc/yum/pluginconf.d/priorities.conf
  • yum install vim-enhanced gcc emacs-nox screen net-snmp net-snmp-libs net-snmp-perl net-snmp-perl net-snmp-utils net-snmp-devel nmap
  • yum update

Created User

  • Created user mccarrms
    • /usr/sbin/useradd -m mccarrms
  • Set password for mccarrms
    • passwd mccarrms

Configured Sudo

  • /usr/sbin/visudo
## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.

## Networking
Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool

## Installation and management of software
Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

## Updating the locate database
Cmnd_Alias LOCATE = /usr/sbin/updatedb

## Storage
Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount

## Delegating permissions
Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
Cmnd_Alias DRIVERS = /sbin/modprobe

## Shells
Cmnd_Alias SHELLS = /bin/sh, /bin/bash, /usr/bin/rsh, /bin/dash, /bin/rbash, /bin/su

## Users
Cmnd_Alias USERS = /usr/sbin/useradd, /usr/sbin/userdel

Defaults    requiretty

Defaults    env_reset,tty_tickets,lecture=always,logfile=/var/log/sudo.log
Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
                        LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \
                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
                        _XKB_CHARSET XAUTHORITY"

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
%wheel  ALL=(ALL)       ALL
%admins ALL=(root) ALL, !SHELLS

Configured Networks

  • Configured hostname in /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=admin
GATEWAY=128.153.145.1
  • Verified eth0 configuration for Clarkson Network in /etc/sysconfig/network-scripts/ifcfg-eth0
# Xen Virtual Ethernet
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:17:47:B5
IPADDR=128.153.145.35
NETMASK=255.255.255.0
ONBOOT=yes
  • Verified eth1 configuration for Server Room Network in /etc/sysconfig/network-scripts/ifcfg-eth1
# Xen Virtual Ethernet
DEVICE=eth1
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:09:86:84
IPADDR=10.0.1.60
NETMASK=255.255.255.0
ONBOOT=yes
  • Verified eth2 configuration for Internal Network in /etc/sysconfig/network-scripts/ifcfg-eth2
# Xen Virtual Ethernet
DEVICE=eth2
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:16:36:24:48:B6
IPADDR=10.0.0.25
NETMASK=255.255.255.0
ONBOOT=yes

Configured Hosts

  • Edited /etc/hosts
127.0.0.1       localhost.localdomain   localhost
128.153.145.35  admin.cslabs.clarkson.edu admin.cslabs admin
10.0.1.60       admin.sr.cslabs.clarkson.edu admin.sr.cslabs admin.sr
10.0.0.25       admin.int.cslabs.clarkson.edu admin.int.cslabs admin.int
  • Edited /etc/hosts.allow
For security purposes, this information has been intentionally left off.
  • Edited /etc/hosts.deny
ALL: ALL

Configured DNS Servers

  • Edited /etc/resolv.conf
search cslabs.clarkson.edu clarkson.edu
nameserver 128.153.145.3
nameserver 128.153.145.4

Disabled IP v6

  • Appended the following to /etc/modprobe.conf
install ipv6 /bin/true
  • Disabled IP v6 firewall
    • /sbin/chkconfig ip6tables off

Configured IPtables

Due to the sensitivity of this material, this config file has been left off; however, the following rule is needed.

-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

Configured SSH

  • Edited /etc/ssh/sshd_config
Due to the sensitivity of this material, this config file has been left off.
  • Restarted sshd
    • /etc/init.d/sshd restart

Set Up SSH Login Banner

  • Edited /etc/issue.net
__      _    
 ___ ____/ /_ _  (_)__ 
/ _ `/ _  /  ' \/ / _ \
\_,_/\_,_/_/_/_/_/_//_/
                           

Configured Password Requirements

  • Edited /etc/login.defs
MAIL_DIR        /var/spool/mail

PASS_MAX_DAYS   360
PASS_MIN_DAYS   0
PASS_MIN_LEN    8
PASS_WARN_AGE   60

UID_MIN                   500
UID_MAX                 60000

GID_MIN                   500
GID_MAX                 60000

CREATE_HOME     yes

UMASK           077

USERGROUPS_ENAB yes

MD5_CRYPT_ENAB yes

ENCRYPT_METHOD MD5

Added Custom PATH Variables

  • Added the following to /etc/profile
PATH=$PATH:/usr/sbin:/sbin
export PATH

Configured Aliases

  • Edited /etc/aliases
#
#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#       >>>>>>>>>>      The program "newaliases" must be run after
#       >> NOTE >>      this file is updated for any changes to
#       >>>>>>>>>>      show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster:     logwatch@cslabs.clarkson.edu

# General redirections for pseudo accounts.
bin:            logwatch@cslabs.clarkson.edu
daemon:         logwatch@cslabs.clarkson.edu
adm:            logwatch@cslabs.clarkson.edu
lp:             logwatch@cslabs.clarkson.edu
sync:           logwatch@cslabs.clarkson.edu
shutdown:       logwatch@cslabs.clarkson.edu
halt:           logwatch@cslabs.clarkson.edu
mail:           logwatch@cslabs.clarkson.edu
news:           logwatch@cslabs.clarkson.edu
uucp:           logwatch@cslabs.clarkson.edu
operator:       logwatch@cslabs.clarkson.edu
games:          logwatch@cslabs.clarkson.edu
gopher:         logwatch@cslabs.clarkson.edu
ftp:            logwatch@cslabs.clarkson.edu
nobody:         logwatch@cslabs.clarkson.edu
radiusd:        logwatch@cslabs.clarkson.edu
nut:            logwatch@cslabs.clarkson.edu
dbus:           logwatch@cslabs.clarkson.edu
vcsa:           logwatch@cslabs.clarkson.edu
canna:          logwatch@cslabs.clarkson.edu
wnn:            logwatch@cslabs.clarkson.edu
rpm:            logwatch@cslabs.clarkson.edu
nscd:           logwatch@cslabs.clarkson.edu
pcap:           logwatch@cslabs.clarkson.edu
apache:         logwatch@cslabs.clarkson.edu
webalizer:      logwatch@cslabs.clarkson.edu
dovecot:        logwatch@cslabs.clarkson.edu
fax:            logwatch@cslabs.clarkson.edu
quagga:         logwatch@cslabs.clarkson.edu
radvd:          logwatch@cslabs.clarkson.edu
pvm:            logwatch@cslabs.clarkson.edu
amanda:         logwatch@cslabs.clarkson.edu
privoxy:        logwatch@cslabs.clarkson.edu
ident:          logwatch@cslabs.clarkson.edu
named:          logwatch@cslabs.clarkson.edu
xfs:            logwatch@cslabs.clarkson.edu
gdm:            logwatch@cslabs.clarkson.edu
mailnull:       logwatch@cslabs.clarkson.edu
postgres:       logwatch@cslabs.clarkson.edu
sshd:           logwatch@cslabs.clarkson.edu
smmsp:          logwatch@cslabs.clarkson.edu
postfix:        logwatch@cslabs.clarkson.edu
netdump:        logwatch@cslabs.clarkson.edu
ldap:           logwatch@cslabs.clarkson.edu
squid:          logwatch@cslabs.clarkson.edu
ntp:            logwatch@cslabs.clarkson.edu
mysql:          logwatch@cslabs.clarkson.edu
desktop:        logwatch@cslabs.clarkson.edu
rpcuser:        logwatch@cslabs.clarkson.edu
rpc:            logwatch@cslabs.clarkson.edu
nfsnobody:      logwatch@cslabs.clarkson.edu

ingres:         logwatch@cslabs.clarkson.edu
system:         logwatch@cslabs.clarkson.edu
toor:           logwatch@cslabs.clarkson.edu
manager:        logwatch@cslabs.clarkson.edu
dumper:         logwatch@cslabs.clarkson.edu
abuse:          logwatch@cslabs.clarkson.edu

newsadm:        news
newsadmin:      news
usenet:         news
ftpadm:         ftp
ftpadmin:       ftp
ftp-adm:        ftp
ftp-admin:      ftp
www:            webmaster
webmaster:      logwatch@cslabs.clarkson.edu
noc:            logwatch@cslabs.clarkson.edu
security:       logwatch@cslabs.clarkson.edu
hostmaster:     logwatch@cslabs.clarkson.edu
info:           postmaster
marketing:      postmaster
sales:          postmaster
support:        postmaster


# trap decode to catch security attacks
decode:         logwatch@cslabs.clarkson.edu

# Person who should get roots's mail
root:           logwatch@cslabs.clarkson.edu
  • Updated aliases
    • /usr/bin/newaliases

Disabled Various Kernel Modules

  • Added the following to /etc/modprobe.conf
install pppox /bin/true
install bluetooth /bin/true
install sctp /bin/true

Installed & Configured SNMP

  • Installed needed packages
yum install net-snmp ntp
  • Configured SNMP Daemon /etc/snmp/snmpd.conf
rocommunity     <passphrase>  127.0.0.1
rocommunity     <passphrase>  <ipsallowed>
 
syslocation Clarkson University Applied CS Labs
syscontact Matt McCarrell <mccarrms@gmail.com>
disk /
disk /var
exec timeskew /usr/local/sbin/ntp_check
exec uptime /usr/bin/uptime
  • Deployed ntp_check script
    • Copied over ntp_check to /usr/local/sbin/
    • chown root.root /usr/local/sbin/ntp_check
  • Configured SNMP to start at specific run levels
/sbin/chkconfig --levels 2345 snmpd on
  • Started daemon
/etc/init.d/snmpd start

Increased Detail of Logwatch Reports

  • Set detail level to be high
echo "Detail = High" >> /etc/logwatch/conf/logwatch.conf

Disabled Unneeded Services

chkconfig nfs off
/etc/init.d/nfs stop
chkconfig nfslock off
/etc/init.d/nfslock stop
chkconfig rpcgssd off
/etc/init.d/rpcgssd stop
chkconfig rpcidmapd off
/etc/init.d/rpcidmapd stop
chkconfig rpcsvcgssd off
/etc/init.d/rpcsvcgssd stop
chkconfig portmap off
/etc/init.d/portmap stop
chkconfig netfs off
/etc/init.d/netfs stop
chkconfig anacron off
/etc/init.d/anacron stop
chkconfig autofs off
/etc/init.d/autofs stop
chkconfig avahi-daemon off
/etc/init.d/avahi-daemon stop
chkconfig avahi-dnsconfd off
/etc/init.d/avahi-dnsconfd stop
chkconfig bluetooth off
/etc/init.d/bluetooth stop
chkconfig hidd off
/etc/init.d/hidd stop
chkconfig cups off
/etc/init.d/cups stop
chkconfig firstboot off
/etc/init.d/firstboot stop
chkconfig gpm off
/etc/init.d/gpm stop
chkconfig haldaemon off
/etc/init.d/haldaemon stop
chkconfig irda off
/etc/init.d/irda stop
chkconfig kudzu off
/etc/init.d/kudzu stop
chkconfig messagebus off
/etc/init.d/messagebus stop
chkconfig microcode_ctl off
/etc/init.d/microcode_ctl stop
chkconfig pcscd off
/etc/init.d/pcscd stop
chkconfig readahead_early off
/etc/init.d/readahead_early stop
chkconfig readahead_later off
/etc/init.d/readahead_later stop
chkconfig ypbind off
/etc/init.d/ypbind stop

Modified Cron Weekly Execution Time

This was done to reduce load spikes that produce Nagios alerts around 4:30 AM every Sunday. In the event that this VM get moved off of righteous, this should be changed back to the default setting of 4:22 AM.
  • Modified the following line in /etc/crontab
32 5 * * 0 root run-parts /etc/cron.weekly

Installed Apache

  • yum install httpd mod_ssl openssl-devel php php-devel php-gd php-imap php-ldap php-mysql php-suhosin php-odbc php-pear php-xml php-xmlrpc mysql
  • Modified Apache Config /etc/httpd/conf/httpd.conf
ServerTokens Prod
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
TraceEnable Off

<IfModule prefork.c>
StartServers       5
MinSpareServers    5
MaxSpareServers   10
ServerLimit       50
MaxClients        50
MaxRequestsPerChild  0
</IfModule>

<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>

Listen 80

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule version_module modules/mod_version.so

Include conf.d/*.conf

User apache
Group apache

ServerAdmin web-admin@cslabs.clarkson.edu

UseCanonicalName Off

DocumentRoot "/var/www/html"

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_userdir.c>
    UserDir disable
</IfModule>

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
#   MIMEMagicFile /usr/share/magic.mime
    MIMEMagicFile conf/magic
</IfModule>

HostnameLookups Off

ErrorLog logs/error_log
LogLevel warn

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

ServerSignature Off

Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<IfModule mod_dav_fs.c>
    # Location of the WebDAV lock database.
    DAVLockDB /var/lib/dav/lockdb
</IfModule>

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README.html
HeaderName HEADER.html

IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset UTF-8

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddHandler type-map var

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>
<IfModule mod_include.c>
    <Directory "/var/www/error">
        AllowOverride None
        Options IncludesNoExec
        AddOutputFilter Includes html
        AddHandler type-map var
        Order allow,deny
        Allow from all
        LanguagePriority en es de fr
        ForceLanguagePriority Prefer Fallback
    </Directory>
</IfModule>
</IfModule>

#ErrorDocument 404 /error/404.html

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "MS FrontPage" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
BrowserMatch "^XML Spy" redirect-carefully
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/atom_xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE application/x-httpd-eruby
AddOutputFilterByType DEFLATE text/html
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  • Disabled /etc/httpd/conf.d/welcome.conf
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
#<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
#</LocationMatch>
  • Configured server so php is not exposed and y2k compliance is off
    • Edited /etc/php.ini
y2k_compliance = Off
expose_php = Off
memory_limit = 128M
  • Disabled /etc/httpd/conf.d/proxy_ajp.conf
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

#
# When loaded, the mod_proxy_ajp module adds support for
# proxying to an AJP/1.3 backend server (such as Tomcat).
# To proxy to an AJP backend, use the "ajp://" URI scheme;
# Tomcat is configured to listen on port 8009 for AJP requests
# by default.
#

#
# Uncomment the following lines to serve the ROOT webapp
# under the /tomcat/ location, and the jsp-examples webapp
# under the /examples/ location.
#
#ProxyPass /tomcat/ ajp://localhost:8009/
#ProxyPass /examples/ ajp://localhost:8009/jsp-examples/

  • Configured Apache to start on boot
    • /sbin/chkconfig --levels 345 httpd on

AWStats