OpenSUSE

Fixing su: cannot set user id: Resources temporarily unavailable in Linux VPS

Last night when i login into my VPS, i found a weird issue in my VPS.
When i type a su command below it shows :

#su -
su: cannot set user id: Resource temporarily unavailable
#


After searching and googling few minutes, i found a quick resolution to fixing this issue.
This is all about VPS limit.

Edit limit.conf below or change if needed.

#vi /etc/security/limit.conf
#### add/change on these line below:
*    soft    nproc    2047

Steps To Fixing Linux Crash Filesystem After Power Outage.

Sometime if we didn't properly shutdown a server that running linux, it will cause a crash for the filesystem.
We need a tool that able to repair it immediately, the tool is FSCK or file system consistency check.

Below is the fsck command :


Usage: fsck [-sACVRTNP] [-t fs-optlist] [filesystem] [fs-specific-options]

Example :

I have a drive /home or /dev/sda3
Then the next step is we need a root access to run the command.

How To FSCK Your Linux LVM Partition

Yesterday i have a problem when my computer can't booting up.
After checking more detail i found that i need to FSCK my partition.

The problem is my linux partition using LVM
Then after googling it for a while

I Found a simple steps to fsck Linux LVM Partition.

First We need to have a linux livecd / rescue cd
Then after reboot it into the livecd and we can see a linux prompt

Then type few lines below to fixed it.
$vgchange --ignorelockingfailure -ay
$lvscan --ignorelockingfailure
$fsck -y /dev/VolumeGroup/LVname

How To Moving All Websites Content Using Wget


Last Week i want to moving a large sites from one server to a new server.
There is a few method to moving all websites content to a brand new server,
First we can using RSYNC, FTP and WGET

In this tutorial i want to using WGET that will moved all sites content in a single line using FTP protocol

We need to prepare a FTP Login from an Old Server that currently host the websites
example :
ip new server :10.10.10.10
user : new
pass : newpassword123

Simple Tutorial to Banned Country IP Address With CSF

I just figure it out a simple way to banned country ip address using CSF.

If you are using a CSF you can edit your CSF config files like below :

Edit csf.conf

#vi /etc/csf.conf

Edit two letters country code in CC_DENY files.
Example : i want to banned US, ID, HK country

CC_Deny = US,ID,HK

If you want to banned others country.
You can take a look link below for the Country Code

How To Install Apache 2.x To Work With GnuTLS

There is another way to using ssl with apache 2.x
The common solution is using OpenSSL with Apache 2.x

But right now i trying to get Apache 2.x to work with mod_gnutls

FYI, GnuTLS support TLS 1.2 and TLS 1.1 that also supported by OpenSSL
But GnuTLS will not supported SSL 2.0

We need to prepare anything related to GnuTLS to work with Apache 2.x
First we need to install those packages below :

Login as Root

1. GnuMP


#mkdir /root/temp
#cd /root/temp

How To Solved Mysqldump: Got error: 1016: Can't Open file when using LOCK Tables

Today, i trying to dump my database but when the dump process begin,
MySQL shows error like below :

Example :

root@rainforest# mysqldump -u root -p mypassword --opt sampledb > backupdb.sql
mysqldump: Got error: 1016: Can't open file: './sampledb/xxx.frm' (errno: 24) when using LOCK TABLES
root@rainforest#

So after googling a way to dump it without any hassle

root@rainforest# mysqldump -u root -p mypassword --opt sampledb --lock-tables=fales > backupdb.sql

From the command above, i can dump my backupdb without any problem

How To Rewrite www to non-www domain using htaccess

Here is a simple way to rewrite your domain from www.yourdomain.com to yourdomain.com without www

This is simply add few lines into your .htaccess files.

Below is the example how to do that

 

<IfModule mod_rewrite.c>
  RewriteEngine on

 RewriteCond %{HTTP_HOST} ^www\.wowtutorial\.org$ [NC]
  RewriteRule ^(.*)$ http://wowtutorial.org/$1 [L,R=301]

</IfModule>

Change it to your domain name.
After that tested it out again.

This should be working

 

How To Force User To Change Password in First Login


Here come to my attention when i want to automatically have my new linux/unix users to change the password when they login into the server.

Login into your server with root access

type chage command :
#chage -d 0 <username>

example i have a username : sentono

#chage -d 0 sentono

-d mean : we will force user to change password when they login into the server for the first time

How To Show Shared Directory from NFS Server Linux


First, we need to know what is NFS ?
NFS is a network file system something like a distributed file system protocol that allowing user on a client computer to access files over network.

For Example : we have few NFS server here and we want to know
how to see all exported file system from unix server using a command line linux

We can using showmount command to see the mount information from NFS server.

Example we have a NFS server named : media10 and the ip address : 10.100.100.1

Facebook Fans