Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sep 10, 2014

How to resize/increase tmpfs partition.

Increasing linux tmpfs partition have two way to do.

1. Modify you /etc/fstab and put the below. Setting below set the tmpfs size to 2GB
LABEL=/     /           ext4    defaults,noatime  1   1
tmpfs       /dev/shm    tmpfs   defaults        0   0
devpts      /dev/pts    devpts  gid=5,mode=620  0   0
sysfs       /sys        sysfs   defaults        0   0
proc        /proc       proc    defaults        0   0

Add size=2G inline to tmpfs besize defaults.
tmpfs       /dev/shm    tmpfs   defaults,size=2G        0   0
After you modify and save your changes, remount the partitions by issuing command below
# mount -o remount /dev/shm
And you done. Or try easier way below.




2. Or if you want the easier way, issue command below to set the tmpfs to 2GB.
sudo mount -o remount,size=2048M tmpfs /dev/shm
NOTE: The breakdown of doing this, this setting will revert after the system was rebooted, so I recommend to modify the /etc/fstab

Apr 28, 2014

Apache - httpd dead but pid file exists

In your apache status command, you will receive message httpd dead but pid file exists. Below are possible, solution to fixed.


Restart your apache.
# /etc/init.d/http restart
or
services httpd restart


TIPS: To stop this possible errors, After you install shared libraries in system. Try to restart this service, or reboot your system to sure that all possible services affected, will include in the affected module.

Apr 27, 2014

CRON - NOT WORKING FAILED to authorize user with PAM (Module is unknown)

Scenario: After I install and update some modules,I notice that my CRON is not working anymore and receive message.

FAILED to authorize user with PAM (Module is unknown)

After I google the message I found the restarting the CRON Service will made the miracle..

# /etc/init.d/crond restart
or
# services crond restart
TIPS: In every time you made update on you system, please find a time to reboot your system.






Sep 17, 2013

SSH - How to configure ssh-agent.

This is the simple script to activate the ssh-agent

If you are using bash, copy the code below and paste at the end of ~/.profile or ~/.bash_profile file. The user profile file defends on the linux distro you use. But as I notice Debian(OpenSuse, Ubunto) use ~/.profile and RHEL(Fedora, CentOS) use ~/.bash_profile. By the way the code below are need to put the end of you user profile.
SSH_ENV=$HOME/.ssh/environment

function start_agent {
     echo "Initialising new SSH agent..."
     /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
     echo succeeded
     chmod 600 ${SSH_ENV}
     . ${SSH_ENV} > /dev/null
     /usr/bin/ssh-add;
}

# Source SSH settings, if applicable

if [ -f "${SSH_ENV}" ]; then
     . ${SSH_ENV} > /dev/null
     #ps ${SSH_AGENT_PID} doesn’t work under cywgin
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh- agent$ > /dev/null || {
         start_agent;
     }
else
     start_agent;
fi
If you are using tcsh, copy the code below and paste at the end of ~/.login file.
set SSH_AGENT=/usr/bin/ssh-agent
set SSH_AGENT_ARGS="-c"
set TMP_FILE=~/.ssh/ssh-agent-info

#
#  Check for existing ssh-agent process
#
if ( -s $TMP_FILE ) source $TMP_FILE
if ( $?SSH_AGENT_PID ) then
  set this=`ps -elf | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null`
  # start ssh-agent if status is nonzero
  if (( $? != 0 ) && ( -x "$SSH_AGENT" )) then
    $SSH_AGENT $SSH_AGENT_ARGS | head -2 > $TMP_FILE
    source $TMP_FILE
    echo "ssh agent started [${SSH_AGENT_PID}]"
    ssh-add
  endif
endif



May 15, 2013

How to charge iPad/iPhone on linux(OpenSuse)

Im not sure if this already in the package repository OpenSuse. Since Spec file already already found opensuse. As I say Im NOT SURE, But I want you to try if you are use the latest/later version of OpenSuse. Currently Im using OpenSuse 11.2.

Try to go in your YAST package and search "ipad_charge". If exists, your lucky. :) But If not. Try to compile it. Please follow instruction below.

Initial requirement:
1 libusb-1.x.x and libusb-1.x.x-dev
2. gcc


1. Download the ipad_charge source to Rainbow Software or ipad_charge.

2. Remember to Install libusb-1.x.x and libusb-1.x.x-dev.
3. Extract the downloaded source code of ipad_charge.
syntax3rror@syntax3rror:~/Utils> tar -xzf ~/Installer/ipad_charge_1.1.tar.gz
4. Change the directory where you extractthe source. For me I extract Utils.
syntax3rror@syntax3rror:~/Utils> cd ipad_charge-1.1/
5 Compile and install the source code.
make
sudo make install
That's it, your DONE.


Possible error encounter.
syntax3rror@syntax3rror:~/Utils/ipad_charge-1.1> make
gcc -Wall -Wextra ipad_charge.c -lusb-1.0 -o ipad_charge
ipad_charge.c:7:31: fatal error: libusb-1.0/libusb.h: No such file or directory
compilation terminated.
make: *** [ipad_charge] Error 1
This error encounter when you forgot to install libusb-1.x.x and libusb-1.x.x-dev.

Mar 22, 2012

SVN: SSL handshake failed: Secure connection truncated

I experience this error in my fedora 14 with svn version

svn --version
svn, version 1.6.17 (r1128011)
compiled Jun 2 2011, 15:23:50

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
- handles 'http' scheme
- handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
- with Cyrus SASL authentication
- handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
- handles 'file' scheme



Here my command

$ svn export https://mycode.googlecode.com/svn/trunk/ mycode --username admin@syntax3rror.co.cc


Response

svn: OPTIONS of 'https://mycode.googlecode.com/svn/trunk': SSL handshake failed: Secure connection truncated (https://mycode.googlecode.com)


From Jan's Blog instructed to install libneon27 However before in install I check /usr/lib/libneon.so.27 and exist to my filesystem so I just issue.

sudo ln -s /usr/lib/libneon.so.27 /usr/lib/libneon-gnutls.so.27


Cheers.. :)

Feb 23, 2012

Linux: Find old files

This important to remove unused logs.

Examples
Find files more than or equal to 3 days
find . -name '*.log' -mtime +3

Feb 14, 2012

Linux: Getting Directory size.

du --max-depth=1 /home/ | sort -n -r
du -sh *

Reference:
http://www.labtestproject.com/linuxcmd/du_command.html

Jan 24, 2012

Linux: Date calculation

Yesterday



winzter]$ date --date='1 day ago' +%Y%m%d
winzter]$ date --date='-1 day' +%Y%m%d
winzter]$ date -d "yesterday" +%Y%m%d

Sep 18, 2011

Aug 23, 2011

Linux: Get SSL certificate


openssl s_client -connect 203.177.165.154:443


Reference: http://curl.haxx.se/docs/sslcerts.html

Aug 7, 2011

Linix: Create/Extract tar file

Create tar.gz file



tar -cvzf mytarfile.tar.gz <directory>


this means:
-c = create new archive
-v = be verbose
-z = compress using gzip
-f = filename to create for the new archive

Extract tar.gz file



tar -xzf mytarfile.tar.gz




Create tar.bz2 file



tar -cvjf mytarfile.tar.gz <directory>


this means:
-c = create new archive
-v = be verbose
-j = compress using bzip2
-f = filename to create for the new archive


Extract tar.bz2 file



tar -xpjf file.tar.bz2

Jul 11, 2011

Jul 7, 2011

Jun 29, 2011

tail: cannot watch `/var/log/messages': No space left on device

Solution:

$ sudo su
# sysctl fs.inotify.max_user_watches
fs.inotify.max_user_watches = 8192
#
# sysctl -w fs.inotify.max_user_watches=16384
fs.inotify.max_user_watches = 16384


Im not sure why we need to higher the


Reference:
tail-cannot-watch-varlogmessages-no

kernel-inotify-watch-limit-reached