Skip to content

The Only Exception Posts

Mabuk ketum

tcn

Dua hari lepas gua balik office lambat. Hampir2 Maghrib gitu. Jadi bila dah sampai dekat lif apartment, ada satu couple suami isteri join gua dalam lif. Akak tu pulak dukung sekor kucing. Aku ingat kucing tu Kokonat, si kucing cekelat yang ramah tamah bulu tebal lagi comel.

Gua ada jugak usulkan dekat bini gua nak culik si Kokonat tu bawak balik rumah, tapi bini gua tak kasi sebab dia alergik dengan bulu kucing. Sebab tu sampai sekarang gua takde kucing macam orang lain.

Nak disambungkan cerita, bila akak dan suami dia masuk lif, gua buat-buat ramah. Gua pun tak tau apa gua fikir time tu, gua tanya soalan macam ni.

“Akak baru ambik kucing ni dekat nursery ke?”

Bila gua keluar daripada lif, baru otak gua sync balik. Perasaan menyesal serta merta datang.

“Bodo tau aku neh.”

Gua story kat bini lepas tu, bini gua gelak. Sampai sekarang dia up gua dalam group Whatsapp. Tapi gua cuba mendefend diri sendiri.

“Secara teknikalnya, pet shop tu nursery lah. Nursery untuk kucing”

Walaupun gua tau gua salah, tapi gua tetap nak cover line. Dalam zaman teknologi serba canggih manggih sosial media ni, gua berharap soalan bengong gua tu tak bersemadi dekat Twitter atau Facebook akak tu lantas jadi viral seluruh negara.

Moral: Balik rumah awal.

Leave a Comment

Tips: Enable Lync 2013 Message Auto Archiving

If you are wondering why your Lync is not keeping IM conversation history, you can take a look at Lync Options > Personal.

In my case, these two checkboxes were grayed out. I haven’t thoroughly investigate if this restriction is imposed by Lync Administrator in my organization.

Lync

Thankfully these two settings can be overriden by modifying your Windows registry. Tested and working.

Open your registry editor (regedit.exe) and navigate to these two keys.

HKEY_CURRENT_USER / SOFTWARE / MICROSOFT / COMMUNICATOR / CallLogAutoArchivingPolicy

HKEY_CURRENT_USER / SOFTWARE / MICROSOFT / COMMUNICATOR / ImAutoArchivingPolicy

Double click those keys and change the hex value from 0 to 1. Restart your Lync and Microsoft Outlook.

***

Update: As expected, GPO reverted back the setting and disabled IM Archiving on my Lync 2013. I raised a ticket to Service Desk and asked them to enable this function and was told by the agent that it is organization policy to disable chat logging. Boo.

Leave a Comment

Linux: Find Top 10 processes utilizing swap.

Updated: Corrected grep syntax problem.

Hello.

Nothing much to do today other than completing some pending documentations for my junior analysts, so I’ve decided to write a helper script to kill some time.

This bash script will display top ten processes which utilizing swap filesystem. It could be very useful if you want to troubleshoot any swap related issue.  I have tested it on Oracle Enterprise Linux and it should be working fine on any Redhat based distribution.

#!/bin/bash
# GSS Linux: Script to find Top 20 processes utilizing swap filesystem.
# Author: Azwan_Ngali (azwan.ngali[AT]gmail.com)
# Linux blusmurf 2.6.32-042stab081.3 #1 SMP Mon Sep 9 20:07:47 MSK 2013 i686

SWAPFREE=$(cat /proc/meminfo | grep SwapFree: | awk -F " " '{print $2}')
SWAPTOTAL=$(cat /proc/meminfo | grep SwapTotal: | awk -F " " '{print $2}')
SWAPUSAGE=$(echo "$SWAPTOTAL - $SWAPFREE" | bc)
SWAPPERCENTAGE=$(echo "scale=3;($SWAPUSAGE / $SWAPTOTAL) * 100" | bc)
COUNTER=0

printf "\n"
printf "Displaying Top 20 processes which utilization swap filesystem  \n"


printf "Current swap utilization (kB): $SWAPFREE / $SWAPTOTAL ($SWAPPERCENTAGE%%)\n"
printf "\n"

printf "%-25s %-25s %-25s\n" "PID" "Swap Utilization (kB)" "Process Name"
printf "%1s\n" "------------------------------------------------------------------------------------------------------------------------"

# Send ps ax output to temporary text file.

ps ax | awk '{print $1 " " $5}' > /tmp/psax_temp.txt

for x in $(grep Swap /proc/[1-9]*/smaps | grep -v '\W0 kB' | tr -s ' ' | cut -d' ' -f-2 | sort -t' ' -k2 -n | tr -d ' ' | tail -20); do

        SWAPUSAGE=$(echo $x | cut -d: -f3)
        PID=$(echo $x | cut -d/ -f3)
        PROCNAME=$(grep -w $PID /tmp/psax_temp.txt | awk '{print $2}')
        printf "%-25s %-25s %-25s\n" $PID $SWAPUSAGE $PROCNAME
        COUNTER=$((COUNTER+1))

done

# No process found.

if [ $COUNTER -eq 0]; then

printf "No process found\n"

fi

# Remove temp file.

rm -f /tmp/psax_temp.txt

Note 1: Processes may appear multiple times if they have multiple memory regions swapped (and these are large)

Note 2: If the above script produces no output, then it could be that none of the currently running processes in /proc/*/smaps are using swap.

You can test that by simply running:

 grep Swap /proc/[1-9]*/smaps | grep -v '\W0 kB'

Important thing to keep in mind is that the aforementioned script will only show the active processes that have memory swapped at that point in time, meaning at the time when the script was run. It might be quite possible that the system has already swapped a chunk of memory and that is visible on free output but the script shows no output. Point being, this script shows the current swapping activity and cannot be used for historical data gathering. For that purpose, sar can be used.

Output example

[root@oracle healthcheck]# ./swap.sh

Displaying Top 20 processes which utilization swap filesystem
Current swap utilization (kB): 7247736 / 16778232 (56.800%)

PID                       Swap Utilization (kB)     Process Name
------------------------------------------------------------------------------------------------------------------------
22640                     15420                     /stornext/snfs1/eradmin/ggs/misc_oc10.2_11gV4/replicat
22440                     15528                     /stornext/snfs1/eradmin/ggs/misc_oc11.1_11gV4/extract
31065                     16208                     /stornext/snfs1/eradmin/ggs/siebeldwngrd_oc11.2_11gV4/replicat
3004                      17372                     /stornext/snfs1/eradmin/ggs/misc_oc10.2_11gV4/extract
17756                     17560                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_2/replicat
4453                      18148                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
668                       19436                     /stornext/snfs1/eradmin/ggs/misc_oc10.2_11gV4/extract
4454                      22516                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
9052                      23292                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
4450                      28996                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
4460                      33824                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
17754                     38468                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_2/replicat
30233                     42912                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_2/replicat
4449                      43308                     /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
9052                      63488                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
9052                      63488                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
9052                      65536                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
9052                      65536                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
9052                      65536                     /opt/dell/srvadmin/sbin/dsm_sa_datamgrd
4467                      4717844                   /stornext/snfs1/eradmin/ggs/misc_tc14.0_11gV1_1/replicat
[root@oracle healthcheck]#

Toodles.

Leave a Comment