Archive for the 'debian' Category

FAQ: How to select fastest APT server in Debian

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

debian swirl logoQuestion: I want to select APT repository server/mirror that is fastest for my location. How can I do it in Debian?

Answer: You can use application named as "netselect-apt" to get new sources.list file with fastest APT mirror. Install this application by command "sudo aptitude install netselect-apt" and run it in accordance with Debian distribution you use (Debian Etch in our example):

sudo netselect-apt -n etch -o /etc/apt/sources.list
sudo apt-get update

P.S. By the way, in Ubuntu you can do the same in a few clicks.

Share This

FAQ: How to retreive hardware manufacturer name, serial numbers, etc. in Linux command line

ibm serial numberQuestion: How can I get information about hardware manufacturer, model name, serial number, BIOS information using Linux command line (CLI)?

Answer: You are welcome to use dmidecode which helps to get information about your system’s hardware as described in your system BIOS. That information typically includes system manufacturer, model name, serial number, BIOS version, asset tag as well as a lot of other details depending on the manufacturer.

Beware that DMI data have proven to be too unreliable to be blindly trusted. Dmidecode does not scan your hardware, it only reports what the BIOS told it to. Dmidecode was first written by Alan Cox and is now being further developed and maintained by Jean Delvare. It is released under the General Public License (GPL).

This tool can be easily downloaded from here (source code) or can be installed as binary package included into repositories of many distributions like Debian, Ubuntu, Gentoo. FreeBSD version is also available. Actualy it is reported that dmidecode works well on the following systems:

  • Linux i386
  • Linux x86_64
  • Linux ia64
  • FreeBSD i386
  • FreeBSD x86_64
  • NetBSD i386
  • OpenBSD i386
  • BeOS i386
  • Cygwin i386
  • Solaris x86 (CVS version)

In Ubuntu (my favourite distro) just execute the following: sudo aptitude install dmidecode (sample output is here).

Share This

ptunnel: send/receive TCP traffic via ICMP reliably

Yes, it can be useful sometimes. For example, you have access to Wi-Fi network but you're not allowed to access Internet via TCP/UDP as these protocols are blocked. At the same time ICMP is opened and you can ping everything alive in Internet. So, to check your email just have ptunnel installed and work around the restrictions set by the Wi-Fi network sysadmin easily.

Ptunnel is an application that allows you to reliably tunnel TCP connections to a remote host using ICMP echo request and reply packets, commonly known as ping requests and replies. It is not a feature-rich tool by any means, but it does what it advertises. So here is what it can do:

  • Tunnel TCP using ICMP echo request and reply packets
  • Connections are reliable (lost packets are resent as necessary)
  • Handles multiple connections
  • Acceptable bandwidth (150 kb/s downstream and about 50 kb/s upstream are the currently measured maximas for one tunnel)
  • Authentication, to prevent just anyone from using your proxy

1. Install ptunnel in Ubuntu or Debian
apt-get install ptunnel

2. Start ptunnel proxy:

ptunnel -p proxy_address -lp listen_port -da destination_address -dp dest_port [-c network_device] [-v verbosity] [-u] [-x password] [-f file]

The following example assumes that ptunnel is run as root, both on the proxy and client. To tunnel ssh connections from the client machine via a proxy running on proxy.pingtunnel.com to the computer login.domain.com, the following command line would be used:

ptunnel -p proxy.pingtunnel.com -lp 8000 -da login.domain.com -dp 22

An ssh connection to login.domain.com can now be established as follows:

ssh -p 8000 localhost

P.S. A brief manual on how to use ptunnel can be got here.
P.P.S. If you are sysadmin and have to forbid Internet access to some user in LAN, don't forget to block ICMP! :)

Share This

Run Photoshop with Ubuntu (or any other Linux)

photoshop logoAdobe Photoshop (or simply Photoshop), is a graphics editor developed and published by Adobe Systems. Currently it’s market leader for commercial bitmap and image manipulation, and is the flagship product of Adobe Systems. Unfortunately it’s available for M$ Windows and Apple OS X users only. Thanks to heaven (and Wine’s developers of course) there is Wine allowing to execute M$ Windows applications (from simple executables to M$ Office and Adobe Photoshop) in Linux. The following instructions will help you to run Photoshop with you favorite Linux like Ubuntu Feisty / Gutsy, Fedora, Debian or OpenSUSE (actually it’s no matter what distribution you use).

1. Install wine (in Ubuntu just execute sudo aptitude install wine, Fedora users may run sudo yum install wine).

2. Configure "Wine Is Not an Emulator":

$ winecfg

When ~/.wine directory is created configuration tool will start and you can set up a virtual desktop with the graphics tabs.

3. Install Photoshop cs2

First of all mount your Photoshop installation CD with the option -o unhide. This will prevent problems with hidden files during the installation.

$ sudo mount -t iso9660 -o unhide /dev/cdrom /media/cdrom0

Then proceed with installation (rather trivial procedure)

$ cd /media/cdrom0
$ wine setup

photoshop cs2 wineAfter this Photoshop setup should start without any errors. Just complete it like you're in M$ Windows (predatory OS definitely). In case the installation is finished and wasn't crashed you can start desired image editor.

4. Run Photoshop

$ cd /home/tom/.wine/drive_c/Program\ Files/Adobe/Adobe\ Photoshop\ CS2
~/.wine/drive_c/Program Files/Adobe/Adobe Photoshop CS2$ wine photoshop.exe

This would show several errors like these ones:

err:shell:HCR_GetFolderAttributes HCR_GetFolderAttributes should be called for simple PIDL’s only!
err:shell:HCR_GetFolderAttributes HCR_GetFolderAttributes should be called for simple PIDL’s only!

photoshop cs2 running in wineBut they shouldn't disturb Photoshop’s normal running (see screenshot below).

There is alternative solution - USE GIMP! As for me, I prefer alternative solution. ;)

Thanks to .

Share This

Clean up your Ubuntu with deborphan

clean upIf you want to clean up your Ubuntu or Debian machine and delete unnecessary (orphaned) deb packages you can use utility deborphan. It finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.

Install deborphan with command sudo apt-get install deborphan and then let’s proceed with cleaning up. To delete unnecessary libraries just execute:
sudo deborphan | xargs sudo apt-get -y remove --purge

To delete unnecessary data packages use command:
sudo deborphan --guess-data | xargs sudo apt-get -y remove --purge

To see all packages which aren't required by any others use command
deborphan --guess-all

At my Ubuntu laptop I've got the following output:
gstreamer0.10-plugins-bad-doc
libusb-dev
libgstreamer-perl
gstreamer0.10-plugins-bad-dbg
gstreamer0.10-plugins-good-doc

libgstreamer-gconf0.8-dev
gstreamer0.10-gnonlin-dev
gstreamer0.10-plugins-ugly-multiverse-dbg
gstreamer0.10-plugins-base-dbg
gstreamer0.10-plugins-ugly-doc
libxcomposite-dev

gtkorphanThere is another tool to delete orphaned packages, it’s GtkOrphan (sudo apt-get install gtkorphan) that does the same as deborphan but is built as graphical application. Once it’s installed go to System --> Administration --> Remove Orphaned Packages, enter your password and proceed with cleaning up.

Another nice tip is to clean partial and orphaned packages by commands:
sudo apt-get autoclean
sudo apt-get autoremove

Share This

Convert WMV into AVI with Ubuntu

mplayer logoActually this tip is applicable to any Linux distribution mencoder can be run at (like Ubuntu, Debian, Fedora, Suse and even Slackware :) )

MEncoder is a free command line video decoding, encoding and filtering tool released under the GNU General Public License. It is a close sibling to MPlayer and can convert all the formats that MPlayer understands into a variety of compressed and uncompressed formats using different codecs

Here is the fastest way to perform wmv to avi conversion:

  1. Ubuntu:
  2. sudo apt-get install mencoder
    mencoder infile.wmv -ofps 23.976 -ovc lavc -oac copy -o outfile.avi

  3. Fedora:
  4. sudo yum install mencoder
    mencoder infile.wmv -ofps 23.976 -ovc lavc -oac copy -o outfile.avi

Share This

Network Traffic Generator: hping

hpinghping3 is a network tool able to send custom TCP/IP packets and to display target replies like ping program does with ICMP replies. hping3 handles fragmentation, arbitrary packets body and size and can be used in order to transfer files encapsulated under supported protocols. Using hping3 you are able to perform at least the following stuff:

  • Test firewall rules
  • Advanced port scanning
  • Test net performance using different protocols, packet size, TOS (type of service) and fragmentation.
  • Path MTU discovery
  • Transferring files between even really fascist firewall rules.
  • Traceroute-like under different protocols.
  • Firewalk-like usage.
  • Remote OS fingerprinting.
  • TCP/IP stack auditing.
  • A lot of others.

I've tried several traffic generators for Ubuntu, Fedora (and other) like scapy, NTG, Bit-Twist, but only hping meets my requirements. Recommended.

Example: to generate 100 packets per second TCP traffic to 192.168.0.1 with packets containing arbitrary destinations, just execute:

sudo aptitude install hping3
sudo hping3 --rand-dest --rand-dest --faster 192.168.0.1

Information Improvisation: Traffic Engineering Server is new network appliance for Bandwidth Management that is especially suitable for Broadband ISPs and SMEs.

Share This



Information Improvisation: Operating system is the backbone for every organization. Having professionals with CISSP certification in organization ensures the life running through its networks. Organizations manage tremendous amounts of traffic due to the use of pc phone and people with 646-058 certifications are ideal for this job. They can also manage online networks which can be hosted on lunarpages, which also provides free email hosting. With the company's logo design every page and a well crafted web template the site can be given a graceful look.