Oct 12 2014

Group photo of class 9, MHSS

Published by under general

IMG_0001.JPG

Comments Off on Group photo of class 9, MHSS

Feb 25 2014

A good TFS 2010 Build tutorial

Published by under general

I happen to chance upon a good tutorial on the above topic. Here is the link for the tutorial

Comments Off on A good TFS 2010 Build tutorial

Nov 17 2013

How to add Swap partition in Debian/Ubuntu

Published by under general

RAM is composed of chunks of memory called Pages.  When programs execute, it takes fills up pages. Due to this sooner or later memory will run out. In order to free up the RAM, Pages can be swapped into hard drive and the freed up RAM can be used by the other program which needs CPU’s attention.

Swap space is not a must in Linux. So if you happen to have a system that does not have Swap space, then follow the below guide to create a swap file and use it.

Check whether a SWAP space is enabled

sudo swapon -s

if you do not have swap enabled in the system you should see the output as below

Filename                                Type            Size    Used    Priority

Check the system for available space.

The recommended swap file size is twice the size of the RAM size. If your RAM
size is 512 MB, then the SWAP file size should be 1GB.

df

Filesystem           1K-blocks      Used        Available Use% Mounted on
/dev/vda              20642428   2367536    17226316  13% /
tmpfs                   254432         0                  254432   0% /lib/init/rw
udev                    249612        60                   249552   1% /dev
tmpfs                   254432         4                    254428   1% /dev/shm

Allocate space for swapfile

sudo fallocate -l 1GB  /swapfile

Create Swap file

sudo mkswap /swapfile

the output will look like below

Setting up swapspace version 1, size = 8388608 KiB
no label, UUID=103c4545-5fc5-47f3-a8b3-dfbdb64fd7eb

Turn on the SWAP file

sudo swapon  /swapfile

You will then be able to see the new swap file when you view the swap summary.

swapon -s
Filename				Type		Size	Used	Priority
/swapfile                               file		8388608 0	-1

TO add this partition permanently, add it into /etc/fstab

sudo nano /etc/fstab

/swapfile  none  swap  sw  0  0

save and close the fstab file.

 

Comments Off on How to add Swap partition in Debian/Ubuntu

Nov 10 2013

C++ Operator Functions Declaration

Published by under C Programming

A summary on how the different operator functions, in C++,  have to be declared

(replace @ by the operator in each case):

Expression Operator Member function Global function
@a        + – * & ! ~ ++ — A::operator@() operator@(A)
a@        ++ — A::operator@(int) operator@(A,int)
a@b        + – * / % ^ & | < > == !=

<= >= << >> && || ,

A::operator@ (B) operator@(A,B)
a@b        = += -= *= /= %= ^= &=

|= <<= >>= []

A::operator@ (B)          –
a(b, c…)        () A::operator() (B, C…)          –
a->x        -> A::operator->()          –

PS: This is for my reference that I copied from cplusplus.com.

Comments Off on C++ Operator Functions Declaration

Oct 20 2013

Postfix master.cf configuration tidbit

Published by under general

If you want to override a named command in main.cf, normally you can specify in the master.cf as override option (-o) to the command.
There is one quirk here though. It cannot contain any white spaces. The manual page explain this clearly. However, it is silent when it comes to parameter values that contains whitespace. There are no examples as well.

The simple trick here is to replace white space with comma as well.

For example:
….. -o smtpd_client_restrictions=check_client_access,hash:/etc/postfix/access

Please see the comma after check_client_access.

But when you use this parameter in main.cf, it will be as below
smtpd_client_restrictions=check_client_access hash:/etc/postfix/access

Comments Off on Postfix master.cf configuration tidbit

Oct 02 2013

How to Mount SMB/CIFS network share in Linux

Published by under linux,Networking

If you have a Home NAS and if it supports SMB/CIFS shares, then follow the steps below to mount those shares in a Linux System.

Prerequisite   Linux system must have “smbfs” and cifs-utils package installed.

Mount CIFS with the default local filesystem permissions:

 # mkdir /mnt/mntpoint # mount -t cifs //server-name/share-name /mnt/mntpoint -o username=shareuser,password=sharepassword
For Example
 # mount -t cifs //192.168.1.2/myfolder /mnt/mntpoint -o username=shareuser,password=sharepassword

Where,

  • username=shareuser : specifies the CIFS user name.
  • password=sharepassword : specifies the CIFS password. If this option is not given then the environment variable PASSWD is used. If the password is not specified directly or indirectly via an argument to mount, mount will prompt for a password, unless the guest option is specified.

For further details and options, please read linux man page for mount.cifs(8). Also, please note that only root user can mount the filesystems.

If you want a particular filesystem to mounted at boot time, then enter a static information about the filesystem you want to mount in /etc/fstab.

For example, in /etc/fstab you need to enter 6 feilds

“file system to be mounted”   “mount point”  “file type”  “options”  ” dump option” “file system check (fsck) value”

//192.168.1.2/myfolder  /mnt/mntpoint cifs  username=shareuser,password=sharepassword 0 0

if you want any user to mount this file system then do the following

//192.168.1.2/myfolder  /mnt/mntpoint cifs  username=shareuser,password=sharepassword,user 0 0

if you want to provide a resolvable hostname instead of IP address, then ensure that you have cifs-utils is installed. Otherwise you will fail to mount with error code -22 . If you do a dmesg after failure you will see the below message

cifs_mount failed w/return code = -22

 

 

Comments Off on How to Mount SMB/CIFS network share in Linux

Next »