To prevent accidental delete rm -rf * in Linux by different ways
If you want to prevent any important directory deleted accidental
Create a file named -i in that directory. How can such a odd file be created? Using touch -- -i or touch ./-i
Now try rm -rf *:
[root@server]# touch {1..4}
[root@server]# touch -- -i
[root@server]#...
Linux users we provide solutions to different Problems we face every Day. This is Linux Troubleshoot Site, developed by Linux users.
Saturday, 31 August 2013
How to prevent accidental delete rm -rf * in Linux
Read More
Thursday, 29 August 2013
Solution : Check Variable in Linux Bash is Float or Interger
Hi,
Here solution for checking a variable in Linux Bash is Float or Integer by using grep.
---- file : test.sh
function check_int(){
echo $1 | grep "^[0-9]*$" > /dev/null
if [ $? -ne 0 ]; then
echo $2 : $1 is not a number;
else
...
Wednesday, 28 August 2013
Create Fake Swap in OpenVZ VPS if you get swapon failed: Operation not permitted Error
if you get swapon failed: Operation not permitted Error even if you run as root it is because in your VPS swap creation is not allowed
follow below steps to Create Fake Swap in OpenVZ VPS
[root@server] free -m
total used free
Mem: ...
How to Copy with overwrite in Linux
To copy content with default overwrite in linux use below command
[root@server1] yes | cp -rf directory1/* /home/director...
How to restrict download speed in wget
To restrict download speed in wget use below command
wget http://wordpress.org/latest.zip --limit-rate=500k
where --limit-rate=500k speed
...
How to Enable .htaccess and Verify if .htaccess file is running
Step 1 : changes in the .htaccess should take effects if you change .conf file of apache like below
<Directory ..>
...
AllowOverride None
...
</Directory>
Should be changed to
<Directory ..>
...
AllowOverride All
...
</Directory>
Step...
Solution: Install/Update Wordpress plugins without providing FTP access
Hi if you don't have FTP access to your wordpress server yow follow below steps to Install/Update Wordpress plugins from wordpress admin panel
step1 : Change "wp-content" folder permissions to 777
sudo chmod -R 777 wp-content
step2 : In "wp-config.php" file add define('FS_METHOD', 'direct');
example :
......
......
/**...
Wednesday, 21 August 2013
Solution : Making of Bootable USB live from Open Suse 12.3 ISO
Hai,
Here is the solution for the opensuse bootable usb live.
Download the Opensuse 12.3 from :
http://mirror1.hs-esslingen.de/pub/Mirrors/ftp.opensuse.org/distribution/12.3/iso/openSUSE-12.3-GNOME-Live-i686.iso
Now login as root in any linux machine
$ cd < location of folder of iso>
$ isohybrid...
Tuesday, 20 August 2013
Solution : SQUID PROXY - NCSA AUTHENCIATION PROBLEM
SQUID PROXY SERVER CONFIG FILE:
sample /etc/squid3/squid.conf :
-------------------------------
auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/passwd
auth_param basic children 5
auth_param basic realm Squid proxy with NCSA
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl...
Wednesday, 14 August 2013
PUTTY command line ssh login with plink
First we need Putty in Linux ?
Download the PUTTY source code file from :
http://the.earth.li/~sgtatham/putty/latest/putty-0.63.tar.gz
After that we need build that package. we need gcc and gcc-devel packages, if you want gui we need gtk-2 packages
$ tar...
Sunday, 4 August 2013
Solution : javac command not found in Linux
Hi if you get javac command not found in Linux even you have
java-open jdk installed means java-devel not there
Install java-devel
In Fedora
yum install java-devel
In Ubuntu
apt-get install java-dev...
Steps to Sign a JAR file using self signed Certificate
To Sign a JAR file using self signed Certificate follow below steps
keytool come with Java, so install Java First
Step1 : Create .jar file from .class file
C:\javaapp> jar cvf VideoANTyd.jar VideoANTyd.class
Step2 : Create a Key by using key tool
C:\javaapp>keytool -genkey -alias selfsigned -keyalg RSA -keysize...
Thursday, 1 August 2013
Simple and Best Linked List example in C
Hi,
Below linked list example is taken from http://www.macs.hw.ac.uk/~rjp/Coursewww/Cwww/linklist.html it is easy and working properly. I did small modifications to it
This example is single linked list
#include<stdlib.h>
#include<stdio.h>
struct list {
int val;
struct list *...
Solution : Implicit Declaration Of Function malloc error in Linux Kernel
Hi if you get Implicit Declaration Of Function malloc error in Linux Kernel then
solution is use vmalloc or kmalloc
kmalloc: Best used for fast allocations that are smaller than a page (PAGE_SIZE, 0x1000 on most architectures). It doesn't involve mapping memory, so you get the memory straight from the kernel's 1:1 physical...
Subscribe to:
Posts (Atom)
Here We Write The Problems we face at different situations and Solutions to those problems.