Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

29 May 2014

Linux & usb

Just a quick guite to mount usb drives via command line:

use fdisk to list all the drives your OS can see:
then simply mount the one you need.

$ sudo fdisk -l
$ sudo mount /dev/sdb1 /mnt/usb


in case you get the error: "special device does not exist"
it is most probably due to an error on the usb device, try formatting it may solve.


Tip: to format a usb drive, enter the followint command

$ mkfs.vfat -n "NEW_DRIVE_NAME" -I /dev/sdx1

(*) replace /dev/sdx1 with the device name of your pendrive (list all the drives using fdisk -l )



3 Mar 2014

Centos: Squid + Report + Webmin gui


1) to install WEBMIN administration gui , you first have to manually ad the repository for YUM:



$ vi /etc/yum.repos.d/webmin.repo

----- add ----
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1
----- add ----



2) then you have to download & install the webmin GPG public key:



$ wget http://www.webmin.com/jcameron-key.asc
$ rpm --import jcameron-key.asc



3) install webmin with yum:


$ yum install webmin



4) at this point you should have you GUI already running on port 10000:

       open url:  http://servername:10000


5) now you can install SQUID and SARG (squid analysis report generator):


$ rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ yum install squid sarg
$ find / -name sarg.conf 


6) UPDATE:

due to some needs, i ended up using the latest SARG version instead of the one supplied via YUM which is quite old and lacking of some nice features!

So these are the steps i followed:

1) unistalled sarg via YUM --> yum unistall sarg
2) download latest SARG --> wget http://sourceforge.net/projects/sarg/files/latest/download
3) extract it to /usr/src --> tar xvzf sarg.latest.tgz
4) install it --> basically you have to follow the isntruction in the README file
  • $ cd /usr/src/sarg-2.3.8
  • $ ./configure
  • $ make
  • $ sudo make install
remember to update your /etc/sarg/sarg.conf for your needs, especially for the folder where you want to save your reports.

NOTE for WEBMIN --> be sure to have the same config parameters in your sarg.cong and in your webming interface.


5) i installed my own version of cronjob to create a report every 15 minutes:

  • */15 9-19 * * * /usr/local/bin/sarg -d day-0 -f /etc/sarg/sarg.conf -n

6) last but not least, i also added an "hostalias" file to summarize the logs coming from the same domains:

--- add this line in the /etc/sarg/sarg.conf ---
hostalias /etc/sarg/hostalias

--- and add a new file named /etc/sarg/hostalias containing something like that ---
*.googlevideo.com www.googlevideo.com
*.googlevideo.com:443 www.googlevideo.com











11 Apr 2009

Fedora 10 + nvidia (FC10+Quadro) --> get Compiz to work

FC10 comes with the standatd "nv" drivers which, with latest graphic cards, are not the best. In particular they dont support 3D accel.

1) download the latest NVIDIA drivers:

(!) dont use the www.nvidia.com site to download the dirvers (it's not updated).

1.1) use the forum: go to http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14
1.2) look for the topic "Current NVIDIA Linux graphics driver releases", and get the "Current release".

2) launch the drivers installer:

2.1) to run the installer, you need to turn off the Xserver (type "init 3" in console)
2.2) launch the installer: /root/Downloads/NVIDIA......sh

now, if your really really lucky, the installer will download the kernel from nvidia ftp for you, and will configure the xorg.conf.
In that case, your done. startx and enjoy.

otherwise
(99.9%:)

if your not , youll get an ERROR because you need to rebuild the kernel:

----------------------------------------
REBUILDING THE KERNEL for NVIDIA DRIVERS
----------------------------------------

1) type uname -r2) yum install kernel-devel-
3) make a link to the sources: "ln -s /lib/modules/2.6.27.21-170.2.56.fc10.i686/build/ /usr/src/linux-2.6.27.21/"
4) set the enviroment variable: "export SYSSRC=/usr/src/linux-2.6.27.21" (DONT!!! add the trailing slash here !!!)

try to run the installer. If your still getting errors, try adding also the following packages:

5) yum groupinstall "Development Tools" "Development Libraries"6) yum install kernel-devel xorg-x11-server-sdk pkgconfig

10 Jan 2009

grub spash image

just add the image file to the /grub directory in .xpm.gz format
the default name should be splash.xpm.gz
then rebuild grub image

you can get ready-to-use images anywhere ... eg: here

example commands:

cd /boot/grub
wget http://ubuntuforums.org/attachment.php?attachmentid=17670&d=1161005960
update-grub


that's it :)

linux: change console resolution

to change the console resolution on linux, you need to append a parameter to the kernel boot line:
eg: kernel vga=788

this is the resolution table:

Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
--------+--------------------------------------------------------------
4 bits  |    ?       ?      770       ?        ?        ?         ?
8 bits  |   768     769     771      773      353      775       796
15 bits |    ?      784     787      790      354      793       797
16 bits |    ?      758     788      791      355      794       798
24 bits |    ?      786     789      792       ?       795       799
32 bits |    ?       ?       ?        ?       356       ?

If you want to make it permanet, you can do it via grub:

1) by adding this param in menu.lst to the kernel section on each menu entry you want to use this resolution

eg: kernel /boot/vmlinuz-2.6. [...] vga=788

2) or by adding this param to the # defoptions

eg: # defoptions=quiet splash vga=788
NOTE: it is commented, but is used this way by grub, so leave it commented! ... it's long story :)

REMEMBER: once done, you have to rebuild the grub by issuing the command

$ upgrade-grub