Archive for 2012
How To Setup Default umask Under Linux?
Umask is the number subtracted from the standard permissions when creating a file. Example: each new folder is by default created with 777, so when umask is set to 022, the result is that the permissions will be 777 – 022 = 755.
Most of the time umask will already be set by your distro to 022 but you can change it if you like. You can see what umask value is set with:
If you want to change umask for temporally,
Note: These value will stay until you log out and then return to its default value.
To make it permanent, edit /etc/bashrc or to your ~/.bash_profile.
Most of the time umask will already be set by your distro to 022 but you can change it if you like. You can see what umask value is set with:
# umask
0022If you want to change umask for temporally,
# umask 0044
Note: These value will stay until you log out and then return to its default value.
To make it permanent, edit /etc/bashrc or to your ~/.bash_profile.
route add in Linux
Route manipulates the kernel’s IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig program. |
When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. |
Add static route using “route add”: |
# route add -net 192.168.100.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0 |
If you want persistent static route, you need to edit /etc/sysconfig/network-scripts/route-eth0 file to define static routes for eth0 interface. |
# vim /etc/sysconfig/network-scripts/route-eth0 |
GATEWAY0=192.168.1.1 |
NETMASK0=255.255.255.0 |
ADDRESS0=192.168.100.0 |
Save and close the file. Restart networking: |
# service network restart |
Verify new routing table by, |
# route –n or # netstat –nr |
Change Default User Home Directory While Adding A New User
By default, when we create or add users to Linux System, user’s default home directory is created to /home. To change default directory to /opt/, we need to change few settings as mentioned below: | |||||||||
| |||||||||
STEP 1: Open /etc/default/useradd | |||||||||
| |||||||||
# nano /etc/default/useradd | |||||||||
The default home directory defined by HOME variable, find line that read as follows: | |||||||||
| |||||||||
HOME=/home replace to HOME=/opt/ | |||||||||
| |||||||||
Save and close the file. Now you can add user using regular useradd command: | |||||||||
| |||||||||
# useradd uddika | |||||||||
# passwd -d uddika | |||||||||
| |||||||||
Verify user information: | |||||||||
| |||||||||
# finger uddika | |||||||||
Output: | |||||||||
|
Range of IPS on single Ethernet
How to create a range of ip addresses on ethx. Create a range file in /etc/sysconfig/network-scripts
[root@daddylinux~]# cd /etc/sysconfig/network-scripts
[root@daddylinux~]# nano ifcfg-eth0-range1 Enter this Parameters
DEVICE=eth0 BOOTPROTO=static HWADDR=00:04:75:D4:C8:F9 IPADDR_START=192.168.0.6 IPADDR_END=192.168.0.10 CLONENUM_START=1 NETMASK=255.255.255.0 ONBOOT=yes TYPE=Ethernet
CLONENUM_START -- interface clone number to start using for this range. # eg "1"
Which would start at eth0:1 Configuring Squid Proxy Server
Sure Squid server is a popular open source GPLd proxy and web cache. It has a variety of uses, from speeding up a web server by caching repeated requests, to caching web, name server query , and other network lookups for a group of people sharing network resources. It is primarily designed to run on Linux / Unix-like systems. Squid is a high-performance proxy caching server for Web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, Squid handles all requests in a single, non-blocking, I/O-driven process. Squid keeps meta data and especially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests. Squid consists of a main server program squid, a Domain Name System lookup program (dnsserver), a program for retrieving FTP data (ftpget), and some management and client tools.
1. Check the necessary RPM
#rpm –q squid
if it's not installed first install it
2. Set the default gateway and the DNS on the proxy server, so it has a direct connection as an internet.
#system-config-network-tui
3. Give the information about your local network on the proxy server.
#nano /etc/squid/squid.conf
Press CTRL + W
Search – our_networks
4. Uncomment this lines
#acl our_networks src 192.168.1.0/24 192.168.2.0/24 //Remove # mark
#http_access allow our_networks //Remove # mark
5. Save (CTRL + O) and Exit (CTRL + X) file
6. Start the proxy service
#service squid start
#chkconfig squid on
Settings up proxy clients
The proxy client is an application that required internet through the proxy server
EX – Internet Explorer, Mozilla Firefox
Fire Fox
Edit --> Preferences --> Advanced --> Network --> Settings --> manually proxy configuration
http proxy : 192.168.2.101 port : 3128 // proxy server IP and port number
Now clients have to access internet through proxy………
Controlling web access through proxy
1. Open the following file
#nano /ect/squid/squid.conf
Press CTRL + W
Search – # http_access deny all
Put all the rules that you want to control web access through proxy under the above comment. All the block rules must come before the allow rules
• To block unwanted website
acl blockweb dstdomain .facebook.com .yahoo.com .google.com
http_access deny blockweb
• To block unwanted file download
acl blockfile urlpath_regex –i exe$ mp3$ avi$ rar$
http_access deny blockfile
• To allow POP3/ SMTP to access mail through proxy server
acl allowmail proto POP3 SMTP
http_access allow allowmail
2. Save (CTRL + O) and exit (CTRL +X) the file
3. Reload squid service
#service squid reload
---------------------------------------------------------
List of acl tags and examples
http://wiki.squid-cache.org
---------------------------------------------------------
1. Check the necessary RPM
#rpm –q squid
if it's not installed first install it
#yum install squid
2. Set the default gateway and the DNS on the proxy server, so it has a direct connection as an internet.
#system-config-network-tui
3. Give the information about your local network on the proxy server.
#nano /etc/squid/squid.conf
Press CTRL + W
Search – our_networks
4. Uncomment this lines
#acl our_networks src 192.168.1.0/24 192.168.2.0/24 //Remove # mark
#http_access allow our_networks //Remove # mark
5. Save (CTRL + O) and Exit (CTRL + X) file
6. Start the proxy service
#service squid start
#chkconfig squid on
Settings up proxy clients
The proxy client is an application that required internet through the proxy server
EX – Internet Explorer, Mozilla Firefox
Fire Fox
Edit --> Preferences --> Advanced --> Network --> Settings --> manually proxy configuration
http proxy : 192.168.2.101 port : 3128 // proxy server IP and port number
Now clients have to access internet through proxy………
Controlling web access through proxy
1. Open the following file
#nano /ect/squid/squid.conf
Press CTRL + W
Search – # http_access deny all
Put all the rules that you want to control web access through proxy under the above comment. All the block rules must come before the allow rules
• To block unwanted website
acl blockweb dstdomain .facebook.com .yahoo.com .google.com
http_access deny blockweb
• To block unwanted file download
acl blockfile urlpath_regex –i exe$ mp3$ avi$ rar$
http_access deny blockfile
• To allow POP3/ SMTP to access mail through proxy server
acl allowmail proto POP3 SMTP
http_access allow allowmail
2. Save (CTRL + O) and exit (CTRL +X) the file
3. Reload squid service
#service squid reload
---------------------------------------------------------
List of acl tags and examples
http://wiki.squid-cache.org
---------------------------------------------------------
What’s New in VMware vSphere 5.1?
vSphere 5.1 is VMware’s latest release of its industry-leading virtualization platform. This new release contains the following new features and enhancements:
Compute
• Larger virtual machines – Virtual machines can grow two times larger than in any previous release to support even the most advanced applications. Virtual machines can now have up to 64 virtual CPUs (vCPUs) and 1TB of virtual RAM (vRAM).
• New virtual machine format – New features in the virtual machine format (version 9) in vSphere 5.1 include support for larger virtual machines, CPU performance counters and virtual shared graphics acceleration designed for enhanced performance.
Storage
• Flexible, space-efficient storage for virtual desktop infrastructure (VDI) – A new disk format enables the correct balance between space efficiency and I/O throughput for the virtual desktop.
Network
• vSphere Distributed Switch – Enhancements such as Network Health Check, Configuration Backup and Restore, Roll Back and Recovery, and Link Aggregation Control Protocol support and deliver more enterprise-class networking functionality and a more robust foundation for cloud computing.
• Single-root I/O virtualization (SR-IOV) support – Support for SR-IOV optimizes performance for sophisticated applications.
Computing Measurment Units
. 1 Bit = Binary Digit
· 8 Bits = 1 Byte
· 1024 Bytes = 1 Kilobyte
· 1024 Kilobytes = 1 Megabyte
· 1024 Megabytes = 1 Gigabyte
· 1024 Gigabytes = 1 Terabyte
· 1024 Terabytes = 1 Petabyte
· 1024 Petabytes = 1 Exabyte
· 1024 Exabytes = 1 Zettabyte
· 1024 Zettabytes = 1 Yottabyte
· 1024 Yottabytes = 1 Brontobyte
· 1024 Brontobytes = 1 Geopbyte
· 8 Bits = 1 Byte
· 1024 Bytes = 1 Kilobyte
· 1024 Kilobytes = 1 Megabyte
· 1024 Megabytes = 1 Gigabyte
· 1024 Gigabytes = 1 Terabyte
· 1024 Terabytes = 1 Petabyte
· 1024 Petabytes = 1 Exabyte
· 1024 Exabytes = 1 Zettabyte
· 1024 Zettabytes = 1 Yottabyte
· 1024 Yottabytes = 1 Brontobyte
· 1024 Brontobytes = 1 Geopbyte
XP Run Commands
Accessibility Controls
Add Hardware Wizard
Add/Remove Programs
Administrative Tools
Character Map
Check Disk Utility
Clipboard Viewer
Command Prompt
Component Services
Computer Management
Date and Time Properties
DDE Shares
Device Manager
Direct X Control Panel (If Installed)
Direct X Troubleshooter
Disk Cleanup Utility
Disk Defragment
Disk Management
Disk Partition Manager
Display Properties
Display Properties
Display Properties (w/Appearance Tab Preselected)
Dr. Watson System Troubleshooting Utility
Driver Verifier Utility
Event Viewer
File Signature Verification Tool
Findfast
Folders Properties
Fonts
Fonts Folder
Free Cell Card Game
Game Controllers
Group Policy Editor (XP Prof)
Hearts Card Game
Iexpress Wizard
Indexing Service
Internet Properties
IP Configuration (Display Connection Configuration)
IP Configuration (Display DNS Cache Contents)
IP Configuration (Delete DNS Cache Contents)
IP Configuration (Release All Connections)
IP Configuration (Renew All Connections)
IP Configuration (Refreshes DHCP & Re-Registers DNS)
IP Configuration (Display DHCP Class ID)
IP Configuration (Modifies DHCP Class ID)
Java Control Panel (If Installed)
Keyboard Properties
Local Security Settings
Local Users and Groups
Logs You Out Of Windows
Microsoft Chat
Minesweeper Game
Mouse Properties
Mouse Properties
Netstat
Network Connections
Network Connections
Network Setup Wizard
Notepad
Nview Desktop Manager (If Installed)
Object Packager
ODBC Data Source Administrator
On Screen Keyboard
Opens AC3 Filter (If Installed)
Password Properties
Performance Monitor
Performance Monitor
Phone and Modem Options
Power Configuration
Printers and Faxes
Printers Folder
Private Character Editor
Quicktime (If Installed)
Regional Settings
Registry Editor
Remote Desktop
Removable Storage
Removable Storage Operator Requests
Resultant Set of Policy (XP Prof)
Scanners and Cameras
Scheduled Tasks
Security Center
Services
Shared Folders
Shuts Down Windows
Sounds and Audio
Spider Solitare Card Game
SQL Client Configuration
System Configuration Editor
System Configuration Utility
System File Checker Utility (Scan Immediately)
System File Checker Utility (Scan Once At Next Boot)
System File Checker Utility (Scan On Every Boot)
System File Checker Utility (Return to Default Setting)
System File Checker Utility (Purge File Cache)
System File Checker Utility (Set Cache Size to size x)
System Properties
Task Manager
Telnet Client
Traceroute
User Account Management
Utility Manager
Windows Firewall
Windows Magnifier
Windows Management Infrastructure
Windows System Security Tool
Windows Update Launches
Windows XP Tour Wizard
Wordpad
access.cpl
hdwwiz.cpl
appwiz.cpl
certmgr.msc
charmap
chkdsk
clipbrd
cmd
dcomcnfg
compmgmt.msc
timedate.cpl
ddeshare
devmgmt.msc
directx.cpl
dxdiag
cleanmgr
dfrg.msc
diskmgmt.msc
diskpart
control desktop
desk.cpl
control color
drwtsn32
verifier
eventvwr.msc
sigverif
findfast.cpl
control folders
control fonts
fonts
freecell
joy.cpl
gpedit.msc
mshearts
iexpress
ciadv.msc
inetcpl.cpl
ipconfig /all
ipconfig /displaydns
ipconfig /flushdns
ipconfig /release
ipconfig /renew
ipconfig /registerdns
ipconfig /showclassid
ipconfig /setclassid
javaws
control keyboard
secpol.msc
lusrmgr.msc
logoff
winchat
winmine
control mouse
main.cpl
netstatÂ
control netconnections
ncpa.cpl
netsetup.cpl
notepad
nvtuicpl.cpl
packager
odbccp32.cpl
osk
ac3filter.cpl
password.cpl
perfmon.msc
perfmon
telephon.cpl
powercfg.cpl
control printers
printers
eudcedit
QuickTime.cpl
intl.cpl
regedit
mstsc
ntmsmgr.msc
ntmsoprq.msc
rsop.msc
sticpl.cpl
control schedtasks
wscui.cpl
services.msc
fsmgmt.msc
shutdown
mmsys.cpl
spider
cliconfg
sysedit
msconfig
sfc /scannow
sfc /scanonce
sfc /scanboot
sfc /revert
sfc /purgecache
sfc /cachesize=x
sysdm.cpl
taskmgr
telnet
tracert <hostname or IP>
nusrmgr.cpl
utilman
firewall.cpl
magnify
wmimgmt.msc
syskey
wupdmgr
tourstart
write