Quantcast
Channel: Unix – L'Antre du Tryphon
Browsing latest articles
Browse All 26 View Live

How to unmount an encrypted partition?

Unmount the partition umount /mnt Unmap the partition cryptsetup luksClose securebackup

View Article



Initializing a brand new disk with “parted”

“parted” is a replacement for “fdisk” of Linux.  It can handle disks larger than 2 TB.  Issue this command to launch “parted” where /dev/sdL is the disk you want to initialize. parted /dev/sdL Create a...

View Article

Create an ext3 or an ext4 partition without a journal

Most of the time, having a journal for ext3 and ext4 partitions is pretty useful. Nevertheless, you can prevent creating a journal by adding the option ^has_journal. For example: mkfs -t ext4 -O...

View Article

Masquerading or replacing outgoing SMTP email address with Postfix

Postfix can replace an outgoing email address by another one. To do so, you must perform these steps: Add in /etc/postfix/main.cf the following line smtp_generic_maps = hash:/etc/postfix/generic_maps...

View Article

How To Setup A Protected Wireless Connection Via the Command-Line

Setting up a wireless connection via the command line may vary depending on the USB Wireless Interface you are using. These instructions also work for the Raspberry PI running Wheezy. You must be root...

View Article


Recording a terminal session under Linux

It is possible to record a terminal session under Linux with ttyrec. It also records vi, emacs, etc. sessions. Fisrt, install ttyrec sudo apt-get install ttyrec To start recording a session: ttyrec To...

View Article

Script listing all the keys on a memcache server

This script lists all the keys on a memcache server. #!/bin/bash nc localhost 11211 > /tmp/$$.1 <<EOF stats items EOF cut -d: -f2 /tmp/$$.1 | grep -v END | uniq | sed 's/^/stats cachedump /' \...

View Article

Accessing a serial port from a web server

On most Linux distribution, it is not possible to access a serial port (ex. /dev/ttyS0) from a web server such as Apache or lighttpd using a cgi for example. Simply add the user under which the web...

View Article


How to find duplicate files on Linux?

It is pretty straight forward in Linux, install fdupes. sudo apt-get install fdupes Type the following command to display the documentation man fdupes

View Article


How to change the network interface name in Ubuntu 12/13

Two files need to be modified to change the name of a network interface in Ubuntu. For example, if you want to change eth0 for lan, simply change the NAME attribute from eth0 to lan in these files and...

View Article

How to assign a static IP address in Ubuntu

Setting a static IP address in Ubuntu involves editing /etc/network/interfaces. If the interface is currently using DHCP, you will find these lines in the file. auto lan iface lan inet dhcp You will...

View Article

How to prevent SSHD to listen on an address family

It is possible to control on which address family sshd will listen to. In /etc/ssh/sshd_config, simply add AddressFamily any to listen to IPv4 and IPv6 addresses. This is the default. Alternatively,...

View Article

How to use the command line to make the internal speaker beep

Two simple steps: Install the beep utility. Executing beep on the command line will make the internal speaker beep. apt-get install beep Add pcspkr to /etc/modules to load it at boot time. You can load...

View Article


How to rename a user in Linux

Simply issue this command: usermod -m -d /home/new-account-name -l new-account-name old-account-name It creates the home directory if it does not exists. It also copy the stuff of the old user into the...

View Article

Issues after upgrading to Ubuntu 14.04.1

After upgrading to Ubuntu 14.04.01, I ran into two issues: One with Apache2 and one with Samba 4. Apache has been upgraded from 2.2.22 to 2.4.7. The content was no longer accessible. The site...

View Article


Installing memcached to use it with php

Installing Memcached with php support in Ubuntu is a matter of a few steps: sudo apt-get install memcached php5-memcached sudo service apache2 restart You can test if memcached is active by running...

View Article

Make an Apache2 SSL server more secure

These easy steps will improve significantly the security of your Apache2 SSL server. Edit your /etc/apache2/mods-enabled/ssl.conf file and replace the SSLProtocol, SSLCipherSuite and...

View Article


Image may be NSFW.
Clik here to view.

How about a Raspberry PI 2 as a firewall?

A Raspberry PI 2 performs as expected exceptionally well as a firewall. The download throughput achieved was 33 Mbits/sec under the same test conditions as the previous test (see Can A Raspberry PI Be...

View Article

Image may be NSFW.
Clik here to view.

Port forwarding using SSH

SSH port forwarding let you connect to a server using another server a relay. For example, if you host a web server in a DMZ behind your office router, you will not be able to access it using its...

View Article

Script to create a shared git project

This script creates a git project to be shared among the users of the Unix group $GIT_GROUP. Every git project will be created into the directory $REPOSITORIES_BASE_DIR. #!/bin/bash # Base directory...

View Article
Browsing latest articles
Browse All 26 View Live




Latest Images