Friday 8 October 2010

Slackware ClamAV Antivirus Setup and use in Thunar

 a) Create clamav group and user in system as :

groupadd clamav
useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav

b) Download the Source code in tar.gz format
from
URL1: http://www.clamav.net/lang/en/download/sources/
(look for latest stable release)
URL2: http://freshmeat.net/urls/c9bfa0aa2a4b8f3dc21e37debf0b05e5
c)  extract the tar and install the ClamAV.

tar -xzvf clamav-0.96.3.tar.gz
cd clamav-0.96.3
./configure --sysconfdir=/etc
make
make install


d) Test It on console as:
clamscan filename

if you get any error for .so , try rebooting the system.


e) to update the antivirus DataBase.
freshclam

I use this command in my root cron which run every hour.

OR/AND to run this command as daemon
freshclam -d

use whichever suits you.

f) I like AV option in right click menu in my XFCE. so I use custom command which i create as :

login to console and :
mkdir -p $HOME/clamav/quarantine

go to Thunar -> Edit->Configure Custom Actions-> [+] add new.
Name = ClamAv Scan
Description = ClamAV Scanner
command = clamscan --bell --log=$HOME/clamav/logfile --recursive=yes --move=$HOME/clamav/quarantine/ --detect-pua=yes --detect-structured=yes  --scan-mail=yes --phishing-sigs=yes  --phishing-scan-urls=yes --phishing-ssl=yes --phishing-cloak=yes  --algorithmic-detection=yes --scan-pe=yes --scan-elf=yes --scan-ole2=yes  --scan-pdf=yes  --scan-html=yes  --scan-archive=yes  --detect-broken=yes %F



Add any favorite icon or clam-av icon from system and that's it.


I hope this helps.
Cheers!!


Sunday 26 September 2010

protect XFCE panel

There is a kiosk mode.
usign which panel can be protected.

http://wiki.xfce.org/howto/kiosk_mode

Wednesday 15 September 2010

Multimedia Keys in XFCE

VolumeUp :            amixer -q set Master  2+ unmute 



VolumeDown:         amixer -q set Master  2- unmute 

Mute:                    amixer -q set Master toggle 



there is much more to refer: see the link( for dell inspiron )



Tuesday 14 September 2010

Slackware Linux Wireless mystery..

There are three primary configuration files that need to be configured before we can use our card, and they are:
/etc/rc.d/rc.inet1.conf
/etc/rc.d/rc.wireless.conf
/etc/wpa_supplicant.conf

First, I must mention that I find the rc.wireless.conf to not be of much value. It is more of a "global" wireless settings file that all wireless interfaces would inherit parameters from. While this might be useful in certain apps, I personally think it makes more sense to specify the wireless settings in rc.inet1.conf on a per-interface basis, just as you would for wired ethX connections. This allows you to specify unique settings for each wireless interface you may have on your system (useful if you have more than one). Thus, in my rc.wireless.conf I deleted all the provided examples and simply have the below.
# cat /etc/rc.d/rc.wireless.conf
VERBOSE=1
case "$HWADDR" in
# Generic example (decribe all possible settings)
*)
#INFO="Fill with your own settings..."
# ESSID (extended network name) : My Network, any
ESSID="SKY12345"
# NWID/Domain (cell identifier) : 89AB, 100, off
#NWID=""
# Operation mode : Ad-Hoc, Managed, Master, Repeater, Secondary, auto
#MODE=""
# Frequency or channel : 1, 2, 3 (channel) ; 2.422G, 2.46G (frequency)
#FREQ=""
#CHANNEL=""
# Sensitivity (cell size + roaming speed) : 1, 2, 3 ; -70 (dBm)
#SENS=""
# Bit rate : auto, 1M, 11M
#RATE=""
# Encryption key : 4567-89AB-CD, s:password
KEY="s:MYPASSPHRASE"
# RTS threshold : off, 500
#RTS=""
# Fragmentation threshold : off, 1000
#FRAG=""
# Other iwconfig parameters : power off, ap 01:23:45:67:89:AB
#IWCONFIG=""
# iwspy parameters : + 01:23:45:67:89:AB
#IWSPY=""
# iwpriv parameters : set_port 2, set_histo 50 60
#IWPRIV=""
;;
esac

Everything is commented out in the case statement, but I left the parameter names just incase down the road I ever need to use rc.wireless.conf.
The next step is the configuration of rc.inet1.conf and wpa_supplicant.conf.
rc.inet1.conf will allow us to specify the settings of each wired/wireless interface that is recognized by the output of

# ip link
The relevant (wireless) part of my rc.inet1.conf is as such:
# cat /etc/rc.d/rc.inet1.conf

IFNAME[4]="wlan0" <---- as shown by ifconfig and iwconfig
IPADDR[4]=""
NETMASK[4]=""
USE_DHCP[4]="yes"
WLAN_RATE[4]="54M auto"
WLAN_WPA[4]="wpa_supplicant"
WLAN_WPADRIVER[4]="wext"
The above should be sufficient for the majority of setups.

My advice is to use wpa_supplicant even if your AP does not use a key for access. The default wpa_supplicant.conf provides two network examples. The top (first) one is for an AP that requires a key and the second one is for an AP that does not (free public APs). I will focus my attention on the one that requires a key. Assuming your AP requires a key (most likely WPA-PSK w/ TKIP encryption), you first need to run

# wpa_passphrase essid-of-your-AP passphrase-of-your-AP  >> /etc/wpa_supplicant.conf

e.g.
# wpa_passphrase SKY12345 ABCD12345 >> /etc/wpa_supplicant.conf


This is to get a hexadecimal encryption key to be manually inserted into your wpa_supplicant.conf.



ASIDE: If you are clueless about some of the settings and capabilities of your AP, I suggest running

# iwlist wlan0 scan

If you get a message that the network is down, first type


# ifconfig wlan0 up

 This will show you all the APs that your card has detected, along with the essids, the encryption (if any) that they use, and the supported bit rates of that AP.

An example output of my personal wpa_supplicant.conf (edit, of course, for security reasons):

# cat /etc/wpa_supplicant.conf
# This line enables the use of wpa_cli which is used by rc.wireless
# if possible (to check for successful association)
ctrl_interface=/var/run/wpa_supplicant
# By default, only root (group 0) may use wpa_cli
ctrl_interface_group=wheel
eapol_version=1
ap_scan=1
fast_reauth=1
# WPA protected network, supply your own ESSID and WPAPSK here:
network={
scan_ssid=1
ssid="your-ssid-goes-here"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
#group=CCMP TKIP WEP104 WEP40
#psk below was made with wpa_passphrase
psk=abcdef12345abcdef12345abcdef12345abcdef12345abcdef
}

That's about it! You can either do a full system reboot or run the rc.inet1 script as root. If you want to just run the script on the wlan0 interface, the proper command is 'rc.inet1 wlan0_start'.


for information and source: see

Sunday 12 September 2010

C or C++ ..this is what Linus Torvald says.

From: Linus Torvalds <torvalds <at> linux-foundation.org>
Subject: Re: [RFC] Convert builin-mailinfo.c to use The Better String Library.
Newsgroups: gmane.comp.version-control.git
Date: 2007-09-06 17:50:28 GMT (3 years, 6 days, 7 hours and 17 minutes ago)
On Wed, 5 Sep 2007, Dmitry Kakurin wrote:
> 
> When I first looked at Git source code two things struck me as odd:
> 1. Pure C as opposed to C++. No idea why. Please don't talk about portability,
> it's BS.

*YOU* are full of bullshit.

C++ is a horrible language. It's made more horrible by the fact that a lot 
of substandard programmers use it, to the point where it's much much 
easier to generate total and utter crap with it. Quite frankly, even if 
the choice of C were to do *nothing* but keep the C++ programmers out, 
that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles 
Bader jokingly said "to piss you off", but it's actually true. I've come 
to the conclusion that any programmer that would prefer the project to be 
in C++ over C is likely a programmer that I really *would* prefer to piss 
off, so that he doesn't come and screw up any project I'm involved with.

C++ leads to really really bad design choices. You invariably start using 
the "nice" library features of the language like STL and Boost and other 
total and utter crap, that may "help" you program, but causes:

 - infinite amounts of pain when they don't work (and anybody who tells me 
   that STL and especially Boost are stable and portable is just so full 
   of BS that it's not even funny)

 - inefficient abstracted programming models where two years down the road 
   you notice that some abstraction wasn't very efficient, but now all 
   your code depends on all the nice object models around it, and you 
   cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and 
portable C++ ends up to limit yourself to all the things that are 
basically available in C. And limiting your project to C means that people 
don't screw that up, and also means that you get a lot of programmers that 
do actually understand low-level issues and don't screw things up with any 
idiotic "object model" crap.

So I'm sorry, but for something like git, where efficiency was a primary 
objective, the "advantages" of C++ is just a huge mistake. The fact that 
we also piss off people who cannot see that is just a big additional 
advantage.

If you want a VCS that is written in C++, go play with Monotone. Really. 
They use a "real database". They use "nice object-oriented libraries". 
They use "nice C++ abstractions". And quite frankly, as a result of all 
these design decisions that sound so appealing to some CS people, the end 
result is a horrible and unmaintainable mess.

But I'm sure you'd like it more than git.

   Linus

Saturday 21 August 2010

Gtalk Video chat in linux.

Yes. this is true.. that now I can use gtalk video natively on Linux without any third party software.

steps I did for getting on the Video.

Goto:
http://www.google.com/talk/

download gtalk video plugin from this page.

I got .deb file which is for debian system and I'm running slackware which expects .txz/ .tgz format..


you can go as :

extract the .deb file using tool ( like ark/ any other zip tool )
copy the data.tar.gz to / ( root )folder.

as a root:
cp data.tar.gz  /
cd /
tar -zxvf data.tar.gz

close the browser
open again and login to Gmail.. and you are on..

if you dont see video icon against your name in gmail. try run this command manually.
/opt/google/talkplugin/GoogleTalkPlugin


If you see the error like
“/opt/google/talkplugin/GoogleTalkPlugin: error while loading shared libraries: libcrypto.so.0.9.8: cannot open shared object file: No such file or directory
fix it by installing Adobe Reader: its available in slackbuild.org , and then creating the symbolic link: cd /usr/lib && ln -s /opt/Adobe/Reader9/Reader/intellinux/lib/libcrypto.so.0.9.8


However I got this running only on google-chrome.. and will check if this is running for firefox and other browser as well.
but as google-chrome is available for all the platform, it should be OK :)


cheers!!

Sunday 1 August 2010

Why Slackware Rules.

I had accidently met with slackware when I crashed my Ubuntu and it wasn't recovertable at all using nice fancy GUI tool for Partitioning.
So it was my first Vote for slackware, when simplicity & robustness wins over the latest packaged graphical stuff.


----------------------
To decide my final distro. I made dual boot my laptop and ran both the distros for a week. ( ubuntu & slackware )
I made all the basic things like updating the systme with required packages which includes.
a) picasa
b) google-chrome
c) avidemux
d) Gimp
e) vlc
f) restricted codecs.. & multimedia related stuff
g) webcam software .


on Uubntu:
---------
1) I personally liked earlier that my system is upto date daily and I am on the bleeding edge software updates. But then I realized that daily updates doesnt mean you are always have a right and secure thing in hand. ( as on Ubuntu-- the next day update comes to fix some security issues ..because of daily updates of other packages. ) and so on...

2) Ubuntu looks shiney/polished and most of point and click which may attract and may suits user coming from Windows background or for non-technical user base.

3) I found Gnome packages well built on Ubuntu as its being supported in main stream and hence a better & polished look. ( but does the look always matters )
anyone could achieve the same using nice compiz effects and additional fonts, so thats not a major factor to decide on.

4) I found several minor glitches on ubuntu which made a first bad impression.

5) Missing of a "root" user in Ubuntu has its own philosophy but when I come from a development environment in corporate company, it always sounds weired as, SUN/AIX/Redhat/... has a standard mechanism to protect certain privileges using root account.

6) Better thing is Ubuntu is its software package management : as When I clicked a .avi file , gnome-player directly asked me that software missing to play this file and on a single click my system updated with the desired package and I'm good to GO.


on slackware:
-------------

1) It looked very well built on first login and I found very huge list of desired packages directly available on http://slackbuild.org

2) after my investement of much time on setting up desired software, efforts went to "ZERO" updating the software. and my system is just running & running without need a KB downlod

3) I found that it actually using less amount of RAM & CPU while doing almost similar task ( RAM usage is noticable, as slackware is not that heavy on hardware )
anyway, this point may not be that valid as running Ubuntu (GNOME) and slackware ( KDE) definitely will have different RAM usage and depends on default services started.

4) I tried XFCE and its very good and good alternative of GNOME look ( GTK), if i'not trying other GNOME builds made for slackware.

5) Doing all the exercise above, I actually learnt some basics of Linux which Ubunut/Suse doesnt provide any feel of.

6) If I crash anything on Slackware, now I know in which file I need to make certain changes and I'll be Up & running again ( I sometimes crashed my Ubuntu & re-installed the OS as i didnt find that transparency )


7) The good point made earlier in comments, that it becomes a security issues when patches are made on kernel and just to make the system working. hence the frequent updates in Kernel as well ( which sometimes need a reboot ... may be not good if you are running a server like stuff.)


based on my experience, here is what I feel on rating of 5.
its just my opinion...




.............................Ubuntu.Scores....Slackware.Scores
Frequent.Updates......4......................1.(I consider low value good here )
Choices.of.Softwares..4......................3
Stability....................3......................5
Robustness...............2......................5
Hardware.Support.....5......................5
Customization...........4......................5
Boot.Time................5......................3


--------------------------------------------------------------------------
just to off this topic. once I heard a small story which gave a message like.

When we/company come into competition, we try to get fame/ attention and want to be alway ahead of others.
That's the same what a Rival also thinks and want to Do.
Greed is the thing which makes money in the pocket but makes loosing of happiness and peace. ( saying : money isnt the happiness )
The people, who just do not because of competition, but for happiness and peace gets a perfect balance.

---------------------------------------------------------------------------
getting back on topic, I think thats somehow suits the slackware philosophy.
no commitment on next release, it would just come when its ready ( no pressure) its a Trust

Other distro in competition, got the fame but not the peace what slackware user has at end of the Day.


So its being a choice ( as what Linux is popular for ). I'm deciding slackware for becoming my Linux