Debian Linux Squeeze 6.0: Install Python v2.6/2.5 Argparse Module

To install the Python Argparse module on Debian Squeeze 6.0, you can use the following steps: Open a terminal window Update the apt-get package manager index by running the following command: sudo apt-get update Install the python-argparse package by running the following command: sudo apt-get install python-argparse This will install the Python Argparse module on … Read more

FreeBSD: Delete User Account Command

You can delete a user account in FreeBSD using the pw command. The following command will delete a user account named “user1”: # pw userdel user1 By default, the user’s home directory and related files will also be deleted. If you want to preserve the user’s home directory, use the -d option with pw userdel: … Read more

Linux / Unix Shell Script: Get The Current Directory

You can get the current directory in a shell script using the pwd command. However, it’s recommended to use the $PWD shell variable, which is automatically set to the current working directory. Here’s an example shell script that prints the current directory: #!/bin/bash echo “Current directory: $PWD” You can also use the $(pwd) command substitution … Read more

Linux: Start / Stop / Restart Apparmor

To start, stop, or restart AppArmor on a Linux system, you can use the following commands: Start AppArmor: $ sudo service apparmor start Stop AppArmor: $ sudo service apparmor stop Restart AppArmor: $ sudo service apparmor restart Note: The exact commands may vary depending on the distribution you are using. On some systems, you may … Read more

Linux / Unix: Use rsync Command Over FTP

To use the rsync command over FTP, you need to use a wrapper such as lftp. Here’s how: Install lftp: sudo apt-get update sudo apt-get install lftp Connect to the FTP server: lftp ftp://<user>:<password>@<hostname>:<port> Replace <user>, <password>, <hostname>, and <port> with the appropriate values for your FTP server. Run the rsync command: mirror -R –no-perms … Read more