blog.up-link.ro
8Mar/120

Ubuntu: How to install the Classic Desktop in Ubuntu 11.10 (Oneiric Ocelot)

Ubuntu 11.10 will not include the classic GNOME desktop which is available alongside Unity in Ubuntu 11.04. Ubuntu 11.10 will automatically use Unity as its default session and fall back to Unity 2D for those whose computers do not support 3D graphics. But if you truly want to go back to Ubuntu Classic Desktop without Unity, then this tutorial will show you how to do it easily. All that’s requires is installing a few extra packages and performing a tweak here and there.

Print This Post Print This Post
24Nov/110

UNIX Tips: How to find broken symbolic links

In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.

1. To display a list of the broken links, execute:

find -L ${dir} -type l

2. To remove the broken links, execute:

find -L ${dir} -type l -print0 | xargs -0 rm
Do not forget to replace ${dir} with the desired directory.

Print This Post Print This Post


2Nov/110

Linux: How to mount SMB/CIFS shares under Linux

This document provides help on mounting SMB/CIFS shares under Linux.
All files accessible in a Linux and UNIX systems are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree.

Use the mount command to mount remote SMB/CIFS shares under Linux as follows:

mount -t cifs //192.168.1.1/mySharedFolder -o username=myUser,password=myPassword /mnt/mySharedFolder

Where,
-t cifs : File system type to be mount
-o : are options passed to mount command, in this example I had passed two options. First argument is the user name (myUser) and second argument is the password (myPassword) to connect to the remote computer.
//192.168.1.1/mySharedFolder : remote computer and share name
/mnt/mySharedFolder : local mount point directory

Make sure to create /mnt/mySharedFolder first.

Print This Post Print This Post
22Sep/110

UNIX Tools: pipe viewer (pv) – monitor the progress of data through a pipe

Pipe Viewer (pv) allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and estimated time of arrival.

pv can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

Print This Post Print This Post
5Aug/110

Linux: How to retrieve and change partition`s UUID

A Universally Unique Identifier (UUID) is an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).

How to retrieve UUID

On some unix systems a hard drives partition is referred by to as UUID instead of the location of the it relevant block device file for example like in /etc/fstab:

UUID=03136e34-6187-4720-8594-b27508ef978f /boot ext3 defaults,noatime 1 2

In this case it would be harder to find which partition is mounted behind /boot. Here are some ways how to retrieve relevant partition UUID.

Print This Post Print This Post
23Jun/110

How To Enable Two-factor SSH authentication via Google Authenticator

In this tutorial I'll show you how to set up two-factor authentication for SSH using Google Authenticator. Two-factor authentication is where you authenticate to a service (SSH in our case) with two pieces of information: one you know, and one you don't. The information you know is your password (which can be stolen) while the information you don't know is a randomly-generated PIN number that changes every few seconds. So even if your password is stolen, unless an attacker has the means to get the right PIN (tied to a hardware device), they cannot log into the protected service.

Print This Post Print This Post
16Oct/100

SSH Security: How To Block SSH Brute Force Attacks with SSHGuard

SSHGuard monitors logging activity and reacts to attacks by blocking their source IP addresses. sshguard has born for protecting SSH servers from the today's widespread brute force attacks, and evolved to an extensible log supervisor for blocking attacks to applications in real-time.

SSHGuard is given log messages in its standard input. By means of a parser, it decides whether an entry is normal activity or attack. After a number of attacks, the IP address is blocked with the firewall.

These are the available blocking backends:

  • SSHGuard with PF (OpenBSD, FreeBSD, NetBSD, DragonFly BSD)
  • SSHGuard with IP FILTER (FreeBSD, NetBSD, Solaris)
  • SSHGuard with IPFW (FreeBSD, Mac OS X)
  • SSHGuard with netfilter/iptables (Linux)
  • SSHGuard with TCP wrappers / hosts.allow (almost any UNIX system)
Print This Post Print This Post
12Sep/100

How To Install and Configure Squid as Transparent Proxy Server under Linux and FreeBSD

Squid is a proxy server and web cache daemon. It has a wide variety of uses: caching web, filtering traffic, caching DNS and other computer network lookups for a group of people sharing network resources.

Squid is primarily designed to run on Unix-like systems but it also runs on Windows-based systems. In this tutorial I'll show you how to install and configure squid proxy server to run under Linux and FreeBSD.

A proxy server software is based on the TCP/IP protocol. It monitors a special port such as 3128 or 8080. A computer who runs a proxy server software is called a proxy server. If other computer want to connect to Internet through the proxy server, it should know the proxy server's IP address and proxy port.

Print This Post Print This Post
4Aug/100

Tip of the day: How to remove duplicate entries in a file without sorting

GNU awk is a programming language that is designed for processing text-based data, either in files or data streams, and was created in the 1970s at Bell Labs.

To remove duplicate entries without sorting them, enter:

gawk '!x[$0]++' filename
Print This Post Print This Post
31May/100

Linux Tips: Keyboard shortcuts and command line tricks

In this article I will show you some keyboard shortcuts and other command line tricks to make entering commands easier and faster. Learning them can make your life a lot easier!

Here are some keyboard shortcuts you can use within terminal:

Alt-r              Undo all changes to the line.
Alt-Ctrl-e        Expand command line.
Alt-p              Non-incremental reverse search of history.
Alt-] x            Moves the cursor forward to the next occurrence of x.
Alt-Ctrl-] x      Moves the cursor backwards to the previous occurrence of x.
Ctrl-a             Move to the start of the line.
Ctrl-e             Move to the end of the line.
Ctrl-u             Delete from the cursor to the beginning of the line.
Ctrl-k             Delete from the cursor to the end of the line.
Ctrl-w            Delete from the cursor to the start of the word.
Ctrl-y             Pastes text from the clipboard.
Ctrl-l              Clear the screen leaving the current line at the top of the screen.
Ctrl-x Ctrl-u    Undo the last changes. Ctrl-_
Ctrl-r              Incremental reverse search of history.
!!                   Execute last command in history
!abc               Execute last command in history beginning with abc
!n                  Execute nth command in history
^abc^xyz       Replace first occurrence of abc with xyz in last command and execute it

Print This Post Print This Post