how to login into the system after the deletion of user folder

0 comments
source : debian-user-digest # 1420.

Issue : I wanted to remove trash folder, but home folder/home/user is gone. There was only one user. I couldn't start any program. When I restarted computer, I couldn't login. How can I recover system.


Solution :

Step 1 : ctrl-alt-f1

Step 2 : login as root
$ su

Step 3 : create home directory of the user, replace the user to your desired username
# mkdir /home/user

Step 4 : change the ownership of the newly created user
# chown user:user /home/user

Step 5 : ctrl-alt-f7

Step 6 : try to login again as normal user
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to force read and write permissions on samba share

0 comments
source : debian-user-digest # 1436,1517.

[ A ] : Have you tried by setting "create mask¹" value for the share ?
¹ http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#CREATEMASK

[ B ] : create mask¹ plus the force create mode.
The relevant part of my smb.conf is

[winshare]
comment = xxx
path = /home/projekte
valid users = xxx, yyyy
read only = No
create mask = 0664
force create mode = 0660
directory mask = 0770
force directory mode = 0770

[ C ] : Try adding write list and force group directives to the share and see if that helps.

Also, look at the [global] section to check there is no value overriding/conflicting with the [winshare] settings.

[ D ] : Also try the security mode options, which work in a similar way to the create/directory mask options :
- force directory security mode
- force security mode
- security mask
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to determine default route in case of multiple network interfaces

0 comments
source : debian-user-digest # 1438.

Any of these :

$ netstat -nr

$ route -n

$ ip route show

how to configure default route for multiple network interfaces

0 comments
source : debian-user-digest # 1441.

In your /etc/network/interfaces
Statically assign an IP to an interface and set the netmask to 255.255.255.255.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to convert alac to wav

0 comments
source : debian-user-digest # 1170,1171.

$ ffmpeg -i input.m4a output.wav

OR

$ mplayer -vo null -vc dummy -ao pcm:waveheader:file="output.wav" "input.m4a"
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to handle situations that you need to do rsync etc ssh relatedtasks in cron

0 comments
source : debian-user-digest # 1520.

When running under cron you cannot use a passphrase on your ssh private key. Since no passphrase can be used you have to ask if you are working in an NFS environment or not.

If under NFS then the only safe user is the root user since root is converted to nobody due to root_squash behavior. In which case all cron activity would need to be under root's account.

If not in an NFS environment then you can safely use filesystem permissions to protect your key.

Create a key without a passphrase and use it for use in cron.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to interrupt filesystem checks

0 comments
source : debian-user-digest # 1564.

Set concurrency as shown below in /etc/default/rcS :
CONCURRENCY=none
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to configure fetchmailrc to download messages to a specific folder

0 comments
source : debian-user-digest # 1264.

In /etc/fetchmailrc :
poll <imap server address> with proto IMAP user XXXXX pass XXXXX is user <folder name> ssl keep
change the imap server address and folder name according to your choice.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to test for page permission enforcement on debian gnu/linux

0 comments
source : debian-security mailing list.

Warning : the shellcode below launches /bin/sh. It is from Aleph One's Smashing the Stack for Fun and Profit. It is generally a bad idea to blindly run someone else's shellcode on your machine since you don't know what it will do ( unless you've analyzed it ). You can and should verify that the following shellcode is the same as listed in Aleph One's article ( found easily via Google ) before running this example.


static char shellcode[] =
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
"\x80\xe8\xdc\xff\xff\xff/bin/sh";

int main() {
void (*function_pointer)(void) = (void *) shellcode;
function_pointer();
return(0);
}
Call it tmp.c.

Now you can test for page permission enforcement :

$ gcc -z execstack tmp.c
$ ./a.out
$ exit  ## <-- this means the stack is executable


$ gcc -z noexecstack tmp.c
$ ./a.out 
Segmentation fault  ## <-- this means the stack is non executable


If ./a.out does not segfault once you have compiled it with -z noexecstack, then page permissions are not being enforced.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

gdm3 logging out and intel 965 chipset

0 comments
source : debian-user-digest # 1170,1171,1191,1192,1197.

running Squeeze, with Xorg and latest kernel - the chipset is an Intel 965.

[ A ] : My first suspicion would be a crash of the X server with a subsequent automatic restart of gdm. Do you see signs of an X server restart or anything else that looks suspicious in /var/log/Xorg.0.log or /var/log/Xorg.0.log.old or /var/log/syslog? Does your screensaver of choice use fancy accelerated graphics which could trigger bugs in your video driver that crash the X server ?

[ B ] : See also the ~/.xsesssion-errors

[ C ] : Fatal server error: Failed to submit batchbuffer: Input/output error

That is a problem with the video driver; your GPU is choking on a set of instructions that it is supposed to execute. Which video chipset do you use, which version of the X server and which kernel ? ( An Intel 845 series chipset with Sid's Xorg and kernel, maybe? )

[ D ] : The other approach is to downgrade the intel driver to the last version that works for your card.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to exclude a username from gdm3 login page

0 comments
source : debian-user-digest # 1524.

Change username to your desired username in /etc/gdm3/daemon.conf :
[greeter]
Exclude=username
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

wifi gets disconnected frequently

0 comments
source : debian-user-digest # 1216,1219.


Is there any kind of wireless encryption involved ? WPA-supplicant running in the background? IIRC network-manager activates wpa-supplicant by default -even if there is no wireless interface- and i remember having seen similar behaviour caused by wpa-supplicant and TKIP/AES mismatch between AP and client.

Kill wpa-supplicant, if it is interfering with ifup. Kill it anyway to find out if it does : fire up wpa_cli as root on a console and enter "terminate" on the CLI. "help" might also be useful for further debugging.

If the link stays up then, check if there's DNS ( DNS is likely to fail if the default ifup script gets interrupted ).

Otherwise try to configure the interface by hand. I do not know which tools are used by your specific HW. Might be iwconfig and iwpriv/iwlist or wlanconfig. Anyway "iwconfig" should show you if wpa_supplicant tried to set some options related to encryption/authorization which might cause the interface to connect, wait for authorization, fail and disconnect to try again.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

udev issue : upgrading lenny to squeeze

0 comments
source : debian-devel-digest # 468.

At least the udev issue is known to me.

It can be worked around by touching /etc/udev/kernel-upgrade before upgrading udev, allowing the kernel and udev to be upgraded at the same time and without reboot between them.

See http://bugs.debian.org/549522, http://bugs.debian.org/566000 and http://bugs.debian.org/571255 for discussion about the udev issue.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to add lenny-backports packages ?

0 comments
Debian GNU/linux packages are stable and old. On September 06, 2010 Debian GNU/linux has included backports service. Now, the backports packages are available for download from Debian GNU/linux mirrors and are part of official Debian GNU/linux ditribution.

Step 1 : In order to download and install packages from lenny-backports, you need to change the sources.list file located at /etc/apt/sources.list.

Type the following command in your terminal :

# vi /etc/apt/sources.list


You can use your favourite editor, vi, vim or nano.

Step 2 : Add the following line in sources.list file :

deb http://backports.debian.org/debian-backports lenny-backports main

and save the file.

Step 3 : Update your sources.list file by running the following command :

# apt-get update


[ OR ]

# aptitude update


Step 4 : To install the lenny-backports package, run the command :

# apt-get -t lenny-backports install &quot;package&quot;


[OR ]

# aptitude -t lenny-backports install &quot;package&quot;


The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to install Flash Player 10 in Debain GNU/linux Lenny ?

0 comments
SOURCE

Architecture : i386, amd64.

Supported Browsers in Debian :

Iceweasel, Epiphany Gecko, Galeon, Opera &gt;= 9.50 beta 1, Konqueror, ... and more


Step 1 : Edit the sources.list :

# vi /etc/apt/sources.list


and add the following line to the file :
deb http://www.backports.org/debian lenny-backports main contrib non-free


Step 2 : update your system :
# apt-get update


Step 3 : All backports are deactivated by default (i.e. the packages are pinned to 1 by using NotAutomatic: yes in the Release files, just as in experimental). If you want to install something from backports run:

# apt-get -t lenny-backports install flashplugin-nonfree

OR

# aptitude -t lenny-backports install flashplugin-nonfree

Step 4 : How to update flashplugin-nonfree :

# apt-get update

# apt-get upgrade

Step 5 : How to update the Adobe Flash Player :

# /usr/sbin/update-flashplugin-nonfree --install

Step 6 : If you want apt to verify the downloaded backports you can import backports.org archive's key into apt:

# apt-get install debian-backports-keyring


Step 7 : Now flash player is installed in your system. What are you waiting for ?

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to install MediaInfo-GUI on Debian GNU/linux lenny ?

0 comments
What is MediaInfo ?

MediaInfo supplies technical and tag information about a video or audio file.

MediaInfo is not included in Debian packages. I don't know why.

To install mediainfo, it requires 2 additional packages : libmediainfo0 & libzen0.

Please download all the packages necessary : MediaInfo-GUI, libmediainfo0 & libzen0. The link to download required files is HERE. I am using i386 as example. I hope you understand CPU types to Debain packages. Please download and install the packages which have yellow background in the following screenshot :


Debian packages generally have dependencies. So, if we don't install dependencies, it leaves the installed package unconfigured. So, to avoid Unconfigured package we install the packages in the following order :

Step 1 : Installation of libzen0.

# dpkg -i /home/YOURUSERNAME/DOWNLOAD-LOCATION-OF-LIBZEN0

Step 2 : Installation of libmediainfo0.

# dpkg -i /home/YOURUSERNAME/DOWNLOAD-LOCATION-OF-LIBMEDIAINFO0

Step 3 : Installation of MediaInfo-GUI.

# dpkg -i /home/YOURUSERNAME/DOWNLOAD-LOCATION-OF-MEDIAINFOGUI

Step 4 : Use the program to find details of your media files.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to take screenshots of exact screen resolution of video file ?

0 comments
To take screenshot of video in it's original resolution you need to install mplayer and imagemagick. This pictorial tutorial will help you. Of curse this is tutorial for Debian GNU/linux Lenny.

Step 1 : Install mplayer [ if you don't have ]

# aptitude install mplayer


Step 2 : Check whether you have imagemagick installed.
To view whether it is installed type the following command
:

# aptitude search imagemagick


If "c" or "p" is preceding the package name, that means package is not installed.

To install package, type the following command :

# aptitude install imagemagick



Step 3 : Now you can cross-verify whether package has not been installed or not :

# aptitude search imagemagick


If installed, the package name is preceded by the letter "i".

Step 4 : Now the packages have been installed, You want to take a screenshot of your favourite scene or video file. You need to type the following command :

$ mplayer -vo x11 PATH-TO-YOUR-VIDEO-FILE




THis step will enable your media file to play.

Step 5 : Now, type the following command to take a screenshot in another terminal or tab of the terminal :

$  import SCREENSHOT-NAME.png


When you enter the command, it will show you a plus sign, place your cursor on the file and single click it, You have your screenshot.

By default, the screenshot is saved in the following folder :
/home/YOUR-USER-NAME/

p.s. I have mentioned about letters "i", "c", "p" for aptitude commands. Please refer to aptitude manual page.

The End.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.