Thursday, March 27, 2014

Centos 6.5 Initial Configuration

---------------------------------------------------------------------

Create an admin user

[root@dlp ~]# useradd centos
[root@dlp ~]# passwd centos
Changing password for user cent.
New UNIX password:                       # set password
Retype new UNIX password:                # Confirm
passwd: all authentication tokens updated successfully.
[root@dlp ~]# exit                       # logout

---------------------------------------------------------------------
 

Try to switch to a user that was added above

dlp login: cent                         # input user name
password:                               # password

[cent@dlp ~]$ su -                      # switch to root
Password:                               # root password
[root@dlp ~]#                           # just switched to root


---------------------------------------------------------------------

Make user 'centos' be the only user who can switch to root as an administration user


[root@dlp ~]#
usermod -G wheel centos

[root@dlp ~]# nano /etc/pam.d/su
change:
#%PAM-1.0
auth        sufficient    pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient    pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
# uncomment the following line
#auth       required      pam_wheel.so use_uid
auth        include       system-auth
account     sufficient    pam_succeed_if.so uid = 0 use_uid quiet
account     include       system-auth
password    include       system-auth
session     include       system-auth
session     optional      pam_xauth.so


To:
#%PAM-1.0
auth        sufficient    pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient    pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
# uncomment the following line

auth       required      pam_wheel.so use_uid
auth        include       system-auth
account     sufficient    pam_succeed_if.so uid = 0 use_uid quiet
account     include       system-auth
password    include       system-auth
session     include       system-auth
session     optional      pam_xauth.so


---------------------------------------------------------------------

Install Webmin using Yum and allow it on iptables

1.create the webmin.repo file using the command below.
nano /etc/yum.repos.d/webmin.repo

Paste the following text inside.
[Webmin]
name=Webmin Distribution Neutral
enabled=1

2.Install the GPG key by running the following commands.
rpm --import jcameron-key.asc

3.Install webmin using yum.
yum install webmin

4.Allow port 10000 using iptables
iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
 -A: append this rule to the input chain (-A INPUT) so we look at incoming traffic
 -p: protocol (tcp)
 --dport: destination port
 -j: Jump to the specified target. By default, iptables allows four targets:
  1. ACCEPT - Accept the packet and stop processing rules in this chain.
  2. REJECT - Reject the packet and notify the sender that we did so, and stop processing rules in this chain.
  3. DROP - Silently ignore the packet, and stop processing rules in this chain.
  4. LOG - Log the packet, and continue processing more rules in this chain. Allows the use of the --log-prefix and --log-level options
5.Save the entry in iptables: 
service iptables save
6.Once Webmin has finished installing you should be load the following address in your browser. 

---------------------------------------------------------------------

Install Webmin using Yum














Wednesday, March 12, 2014

How to edit the Hosts file on a Mac 10.7.5

1.sudo nano /private/etc/hosts

2.Add entry as such:

0.0.0.0     www.yahoo.com

3.DNS flush:
dscacheutil -flushcache;sudo killall -HUP mDNSResponder

Wednesday, November 27, 2013

Reduce PDF size using ghostscript

Make sure ghostscript is installed:
sudo apt-get install ghostscript

Syntax: 
[
 gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
]

-dPDFSETTINGS=/screen   (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook    (low quality, 150 dpi images)
-dPDFSETTINGS=/printer  (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)

Thursday, November 21, 2013

use rsync to sync a folder

rsync -r --progress --delete SOURCE DESTINATION

r: recursive

-progress: show prgress
-delete: If a file is not present at the source, but present at the target, this option deletes the file at the target during rsync.

Tuesday, November 19, 2013

Show All Icons/Indicators in Unity Panel’s Notification Area

Install dconf-editor:
sudo apt-get install dconf-tools

Run dconf-editor
Alt+F2 and enter dconf-editor

desktop > unity > panel

Change:
systray-whitelist ['JavaEmbeddedFrame', 'Mumble', 'Wine', 'Skype', 'hp-systray', 'scp-dbus-service']

to:
systray-whitelist ['all']

Refresh Unity:
Alt+F2 and enter unity --replace


Terminal Command:
gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"