Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, October 1, 2010

Free internet access scripts - resume of developement

Continuing the post about the collection of scripts for using free Internet access here are some updates.
Firstly the scripts for collecting and spofing MAC and IP adresses in a LAN have new location. Here is a link for the package containing both python and perl versions  http://9mhz.info/fisp-0.3.1.tar.gz

A new version will be released soon. Planned features include  MySQL support and some heuristics for choosing which MAC address will be picked up for assignment.  Entry appearance patterns will be applied for some IP-MAC pairs like 'business hours only' etc.

Monday, August 23, 2010

Logitech QuickCam

046d:08f0 Logitech, Inc. QuickCam Messenger with Ubuntu Lucid:

1. Edit /etc/modprobe.d/blacklist.conf and add:


blacklist gspca_stv06xx
blacklist gspca_main


2. Execute:


rmmod gspca_stv06xx
rmmod gspca_main


3. Execute:


rmmod quickcam_messenger
modprobe quickcam_messenger brightness=10000 hue=10000 contrast=10000 whiteness=10000

Tuesday, May 12, 2009

3D acceleration with i965

Optimizing the performance of an Intel 965 graphics card could be a tricky job. The problem gets bigger if you want to use Compiz and have to use the 3D acceleration. There are three available acceleration methods for Intel cards: the old 'XAA', the stable 'EXA' and the not-ready-yet 'UXA'. I found that the default settings give rather poor performance in Unbuntu Jaunty and the result from glxgears was ~480 FPS. With the following settings in xorg.conf I was able to get 750 FPS.


Section "Device"
Identifier "Configured Video Device"
Option "AccelMethod" "EXA"
Option "MigrationHeuristic" "greedy"
Option "ExaNoComposite" "false"
EndSection


Also setting this variable in /etc/environment seems to help as well:

INTEL_BATCH="1"

Thursday, May 7, 2009

Disable frequent hard disk spindown in Ubuntu

By default the hdparm settings in Ubuntu are not hardware friendly so some tuning might be needed to adjust your hard disc parameters. Example for this is the Load_Cycle_Count counter which usually gets increased once in a minute without heavy disc usage. Most of the manufacturers construct their disks with MTBF of 300,000 load cycles, so you might reach it within one year. You don't want to buy a new HDD once a year, don't you? Here is a fix.

Edit /etc/hdparm.conf and add the following section (replace /dev/sda with your actual device):

/dev/sda {
apm=254
spindown_time = 242
read_ahead_sect = 2
keep_settings_over_reset = on
}

Saturday, December 20, 2008

Globul 3G data connect

If you are staring at the sentence "Supported OS: Windows XP/Vista" on your 3G data device and have no clue how to get it working on Linux then this post might help you.

I got a ZTE MF632 device working under Ubuntu Hardy with KPPP.

  • Create a new file /etc/udev/rules.d/57-zte-net.rules and put the following in it





ACTION!="add", GOTO="ZTE_End"

# Is this the ZeroCD device?
SUBSYSTEM=="usb", SYSFS{idProduct}=="2000",
SYSFS{idVendor}=="19d2", GOTO="ZTE_ZeroCD"

# Is this the actual modem?
SUBSYSTEM=="usb", SYSFS{idProduct}=="0001",
SYSFS{idVendor}=="19d2", GOTO="ZTE_Modem"

LABEL="ZTE_ZeroCD"
# This is the ZeroCD part of the card, remove
# the usb_storage kernel module so
# it does not get treated like a storage device
RUN+="/sbin/rmmod usb_storage"

LABEL="ZTE_Modem"
# This is the Modem part of the card, let's
# load usbserial with the correct vendor
# and product ID's so we get our usb serial devices
RUN+="/sbin/modprobe usbserial vendor=0x19d2 product=0x0001",
# Make users belonging to the dialout group
# able to use the usb serial devices.
MODE="660", GROUP="dialout"

LABEL="ZTE_End"


  • Plug your device in the USB port. This should create three new devices /dev/ttyUSB0, /dev/ttyUSB1 and /dev/ttyUSB2. You now can use the first one to connect to the network.

  • Use your favourite PPP program to configure new connection.  Don't forget to set the following parameters:



Modem initialization string 2 = AT+CGDCONT=1,"IP","globul"
Phone = *99***1#
Username = globul
Password = globul

Friday, September 26, 2008

VMware && USB && Ubuntu ?

To be able to use USB devices with VMware guest OSes under Ubuntu Gutsy you have to uncomment lines 42-45 in /etc/init.d/mountdevsubfs.sh




mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb




Then conect with VM->Removable devices -> USB devices

Thursday, September 25, 2008

OpenSSL commands

Some useful openssl commands.

Check certificate details:



openssl  verify -verbose -issuer_checks server.crt



Generate new sertificate:



openssl req -new -x509 -days 365 -key server.key  -out server.crt



Check the modulus of an SSL certificate and key:



openssl rsa -noout -modulus -in server.key | openssl md5

openssl x509 -noout -modulus -in server.crt | openssl md5

Monday, May 12, 2008

Internet via WM6 device on Linux (USB)

This article shows how to use a Windows Mobile 5/6 device’s GPRS connecton with USB cable on Linux. The ‘conventional’ way is to use the /dev/ttyUSB device as a regular modem but since we are quite off the dial-up era we want to connect in a more modern way.


Microsoft provides a Remote NDIS stack, a derivative of the original USB communications device class  CDC to connect usb devices. It can be used in linux with the rndis_host kernel module. To avoid patching your kernel there is a simple way to get an internet connection.


svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite


cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install


Now just plug in the USB cable and connect your device to the network through the Network sharing menu. Voila )

Monday, October 29, 2007

SB450 HDA Audio under Linux

I had some troubles to get any sound out of my Toshiba notebook with the recent kernels 2.6.21 and 2.6.22.  My sound card is


00:14.2 Audio device: ATI Technologies Inc SB450 HDA Audio (rev 01)


However it is working with 2.6.23-rc4 vanilla kernel. I don’t know whether it is a problem in alsa or in the kernel itself but after several hours of googling I finally got it playing.


Firstly you have to put in  /etc/modprobe.d/aliases or whatever module aliases file you have the following


alias snd-card-0 snd-hda-intel


and secondly in /etc/modprobe.d/alsa-base this one


options snd-hda-intel model=auto enable=1 index=0


and voila! Adjust your sound levels with alsamixer -)

Tuesday, July 10, 2007

Creating an Ad-Hoc network

This is a short reference how to create an Ad-hoc network in Linux using the CLI. More detailed article can be found in this Ubuntu guide.


1. Put the wireless interface in ad-hoc mode


iwconfig eth1 mode ad-hoc


2. Set the channel/frequency that you want to use


iwconfig eth1 channel 11


3. Add the name (ssid) for the network you want to create/join. Use single quotes if there is a space in the name.


iwconfig eth1 essid ‘name’


4. Add a WEP encryption key


iwconfig eth1 key ’s:mykey’


5. Bring the interface back up


ifconfig eth1 up


With Atheros based cards you have to take the VAP down in order to create the interface in ad-hoc mode. There are two ways to do this


# rmmod ath_pci


# modprobe ath_pci autocreate=adhoc


# wlanconfig ath0 destroy


# wlanconfig ath create wlandev wifi0 wlanmode adhoc


With cards using ndiswrapper this should work as follows:


# rmmod ndiswrapper


# modprobe ndiswrapper


The example above shows how to setup the network with WEP encryption. If you want to use WPA you have to install wpa_supplicant and configure wpa_supplicant.conf like this:


network={
ssid=”myadhoc”
mode=1
proto=WPA
key_mgmt=WPA-NONE
pairwise=NONE
group=TKIP
psk=”verysecretpass”
}


Then start wpa_supplicant with


# wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -ieth1 -Dwext -Bw


Of course you have to put the correct interface and driver name for this to work.

Thursday, April 12, 2007

Free Internet access for LAN users

Many Internet Service Providers which offer internet access via local area networks (LAN) have very basic user authentication, they distinguish their users only on MAC/IP address pair basis. Of course many use more complex techniques based on PPPoE, PPTP, VLAN, port security; this article does not apply to them.Since the MAC address of the network interface card (NIC) can be easily changed this could lead to account hijacking in no time. The only condition is thay you have to know the MAC and IP addresses of an existing computer in your network.


Fortunately the Ethernet protocol which is used in LAN makes both addresses public and anyone whithin the same ethernet segment can see them. That’s why I wrote a script which automates the gathering process and writes all the MAC/IP pairs to a text file. This file is used as a database for another script which autmatically sets one of the pairs to your NIC.


Usage:



  • Download http://systemv.eu/fisp-0.3.tar.gz

  • Uncompress it using # tar xvzf fisp-0.3.tar.gz; cd fisp

  • Edit the file scan.pl and put in the @networks list the IP networks of your ISP (you can easily see them with tcpdump). In the $db variable set the filename where the gathered information will be stored or you can leave it by default.

  • Execute scan.pl (It is recommended to put it in a cron job or startup script), it will find the computers in the specified networks which are online.

  • Now execute the assign.pl script. It will get the first entry (or the first random one if used with -r option) and set your NIC’s MAC and IP addresses and the gateway. Then it will check if internet connection is present and if this fails it will go to the next entry in the db file and repeat the process. If you use the -c option then the script will exit if it finds existing internet connection.


Note: The script assumes that the gateway address ends with xxx.xxx.xxx.1 of the same network, if in your case this is different you have to change it in the source.


And that’s it. Enjoy )

Friday, April 6, 2007

Cracking WEP in less than 60 seconds

Erik Tews, Andrei Pychkine and Ralf-Philipp Weinmann from the technical university Darmstadt in Germany found even better way to crack WEP. Quoting:


“We were able to extend Klein’s attack and optimize it for usage against WEP. Using our version, it is possible to recover a 104 bit WEP key with probability 50% using just 40,000 captured packets. For 60,000 available data packets, the success probability is about 80% and for 85,000 data packets about 95%. Using active techniques like deauth and ARP re-injection, 40,000 packets can be captured in less than one minute under good condition. The actual computation takes about 3 seconds and 3 MB main memory on a Pentium-M 1.7 GHz and can additionally be optimized for devices with slower CPUs. The same attack can be used for 40 bit keys too with an even higher success probability.”


More information and a proof-of-concept tool is available at http://www.cdc.informatik.tu-darmstadt.de/aircrack-ptw/

Saturday, March 31, 2007

WEP cracking w/ Atheros cards

The following article describes how to crack encrypted wireless networks using WEP protocol in Ubuntu with Atheros based cards.


First install the needed software - aircrack-ng cracking suite and madwifi-tools from debian package which provides the wlanconfig tool which otherwise is not included in ubuntu.


apt-get install aircrack-ng
wget http://ftp.de.debian.org/debian/pool/contrib/m/
madwifi-tools/madwifi-tools_0.9.2+dfsg-1_i386.deb
dpkg -i madwifi-tools_0.9.2+dfsg-1_i386.deb


Then we should bring any virtual access points (VAPs) down in order to create an interface in monitor mode.


ifconfig ath0 down (Take the VAP down)


wlanconfig ath0 destroy (Destroy the VAP)


wlanconfig ath0 create wlandev wifi0 wlanmode monitor (pretty self-explanatory)


Then find on which channel the targeted network is operating. You can do this with running airodump-ng without any arguments.
Now we are ready to capture initialization vectors (IVs) which are required to recover the WEP key.


airodump-ng -c -w


(You need to capture about 250.000 IVs to crack 40-bit WEP, and more than 800.000 IVs to crack a 104-bit key)


aircrack-ng


Enjoy )

Thursday, March 15, 2007

Windows CE pppd

Here are some instructions how to connect a Windows CE portable to a Linux box with pppd.


Windows CE:


Create a modem connection.


Connections -> Direct Connections -> Settings -> Communication -> Identification -> cebox


Linux:


Create the following files in /etc/ppp


cebox.sh:


#!/bin/bash


pppd call cebox


cebox.chat:


Timeout 3600


“CLIENT” “CLIENT\c”


” ” “SERVER\c”


peers/cebox:


/dev/ttyS1 19200 crtscts


connect ‘/usr/sbin/chat -v -t cebox.chat’


noauth


local


192.168.55.101:192.168.55.100


Don’t change the IP addresses since Windows CE seems to connect only if such network is specified. Make /etc/ppp/cebox.sh executable and start it. Then start the modem connection from the Win CE.

Gentoo Linux Mini HOWTO

This a short reference guide for installing Gentoo “the classic way”.


fdisk /dev/hda


mkswap /dev/hdaX
mkfs.ex3 /dev/hdaY


swapon /dev/hdaX
mount /dev/hdaY /mnt/gentoo


cd /mnt/gentoo
wget http://mirrors.ludost.net/gentoo/releases/
x86/current/stages/stage3-i686-2006.1.tar.bz2
tar xvjpf stage3-i686-2006.1.tar.bz2


mount -o bind /proc /mnt/gentoo/proc


cp /etc/resolv.conf /mnt/gentoo/etc/


chroot /mnt/gentoo /bin/bash


env-update
source /etc/profile


emerge –sync


nano -w /etc/make.conf


ln -sf /usr/share/zoneinfo/… /etc/localtime


emerge -sf sys-kernel/gentoo-sources
cd /usr/src/linux
make menuconfig
make bzImage modules modules_instal
cp arch/i386/boot/bzImage /boot


ufed


emerge metalog
emerge dcron


rc-update add medalog default
rc-update add dcron default


passwd


nano -w /etc/fstab


grub


etc-update


exit
cd /
umount /mnt/gentoo/proc
umount /mnt/gentoo


reboot


If you don’t know what some of the commands do or how to use them check out the original Gentoo Linux x86 Quick Install Guide and Gentoo Handbook.