Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Wednesday, May 27, 2015

How to disable CTRL-ALT-DEL from rebooting a Linux system

The action taken for CTRL-ALT-DEL is defined in /etc/inittab and if we will look in that file we will see a line similar to the one from bellow (taken from a Debian system):
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
Here is another example: on RedHat based systems this line will look like:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
If we want to disable this action we only have to change this line. We can delete it, comment it, or even replace it with something like:
ca:12345:ctrlaltdel:/bin/echo "CTRL-ALT-DEL is disabled"
After making any changes to the inittab file, you will have to tell init to reload it, in order to activate the changes. To do that, simply run as root:
init q

Sunday, February 15, 2015

Remote access to Debian Printing (CUPS) web interface from LOCAL

The Common UNIX Printing System (or CUPS) is a printing system and general replacement for lpd and other older systems. The CUPS Debian packages forms a nice, powerful and relatively easy to use printing system on Debian. (http://www.cups.org/)

Install Software:

aptitude update
aptitude install cups cups-client

Start the software:

/etc/init.d/cups start

The easiest way is to use the cups web interface. You can see it by going to

http://localhost:631/admin

But to get to this page remotely for a server, you need to first make some edits to the cupsd.conf file. So do the following:

1. Edit the cups configuration file by first running the following command on your server:

sudo nano /etc/cups/cupsd.conf

2. Change this section :

# Only listen for connections from the local machine.
#Listen localhost:631
Port 631
Listen /var/run/cups/cups.sock

3. Then change this sections :

< Location / >
# Restrict access to the server...
Order allow,deny
Allow from@LOCAL
< /Location >
< Location /admin >
# Restrict access to the admin pages...
Order allow,deny
Allow from@LOCAL
< /Location >
< Location /admin/conf >
AuthType Default
Require user @SYSTEM
# Restrict access to the configuration files...
Order allow,deny
Allow from@LOCAL
< /Location >

4. Finally, restart cups with the following:

sudo /etc/init.d/cups restart

5. You should now be able to log into cups on your server with:

http://your_server_ip_address:631


Note that when you change something, it may tell you that you need to add a certificate to firefox. Do so by clicking the add/get certificate button at the bottom of the firefox error message page. It will also tell you that to change stuff, you need to use the "https" version of the page instead of "http" so just go to:

https://your_server_ip_address:631

You might also have to open/port forward tcp port 631.

Thursday, March 6, 2014

How to combine MP4 files on the Debian linux

How to combine MP4 files on the Debian linux

If you are looking to combine MP4 files from the command line here is the easiest solution.  First you need to use the following command to install the program.

sudo apt-get install gpac

Once installed you will be able to run the following command to join the files.

MP4Box -cat mp4_file_part_1.mp4 -cat mp4_file_part_2.mp4 -new joined_file.mp4

You should now be able to combine MP4 files from the command line, and pretty quick at that.

Tuesday, September 10, 2013

Multiple IP addresses on One Interface

Multiple IP addresses on One Interface

Interface aliasing allows one interface to have multiple IP addresses. This is useful when more than one server is to be visible via the Internet. Note that virtual hosts can support multiple Apache servers with a single IP address. Apache responds to the domain name supplied by the client in the HTTP header. In many other situations, one external IP is needed for each server using a port.
This /etc/network/interfaces text assigns three IP addresses to eth0. 
 
 
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.42
    netmask 255.255.255.0
    gateway 192.168.1.1

auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
    address 192.168.1.43
    netmask 255.255.255.0

auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
    address 192.168.1.44
    netmask 255.255.255.0
 
 
An alias interface should not have "gateway" or "dns-nameservers"; dynamic IP assignment is permissible.
The above configuration is the previous traditional method that reflects the traditional use of ifconfig to configure network devices. ifconfig has introduced the concept of aliased or virtual interfaces. Those types of virtual interfaces have names of the form interface:integer and ifconfig treats them very similarly to real interfaces.
Nowadays ifupdown uses ip utility from the iproute2 package instead of ifconfig. The newer ip utility does not use the same concept of aliases or virtual interfaces. However, it supports assigning arbitrary names to the interfaces (they're called labels). ifupdown uses this feature to support aliased interfaces while using ip.
Also, ifupdown supports specifying multiple interfaces by repeating iface sections with the same interface name. The key difference from the method described above is that all such sections are treated by ifupdown as just one interface, so user can't add or remove them individually. However, up/down commands, as well as scripts, are called for every section as it used to be.
This /etc/network/interfaces text assigns three IP addresses to eth0.
 
 
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.1.42
    netmask 255.255.255.0
    gateway 192.168.1.1

iface eth0 inet static
    address 192.168.1.43
    netmask 255.255.255.0

iface eth0 inet static
    address 192.168.1.44
    netmask 255.255.255.0

# adding IP addresses from different subnets is also possible
iface eth0 inet static
    address 10.10.10.14
    netmask 255.255.255.0


Additional information can be found on the http://www.shorewall.net/Shorewall_and_Aliased_Interfaces.html page.

Tuesday, August 16, 2011

HOW TO : Convert .flv to .mp3 in Ubuntu, Debian Linux

Converting flv to mp3 has become so easy in Linux within few minutes.

Installation of FFmpeg on Debian OR Ubuntu Linux

* root:~#apt-get install ffmpeg

Converting .flv to .mp3

* ffmpeg -i input_filename.flv -acodec copy output_filename.mp3

Good luck :)