Category Archives: Code

Code snips, and programming examples.

Linux and Solid State Drives (SSD)

I started using a 120GB SSD myself recently on my desktop. Running ArchLinux.

Just a few sites to help out anyone doing the same.

http://cptl.org/wp/index.php/2010/03/30/tuning-solid-state-drives-in-linux/

https://wiki.archlinux.org/index.php/SSD#Tips_for_Maximizing_SSD_Performance

Kill all processes not root or daemon

for p in $(ps -ef|tail +2|grep -v root|grep -v daemon|awk '{print $2}'); do
  kill -1 ${p}
done

Drop in a KSH script and run anytime you want to send a kill -1 to all processes that are not owned by root or running under daemon.

Close Application VB6 Module

Simple module for your VB6 projects. This will gracefully close any application you specify.

Close Application VB6 Module

Kill Process VB6 Module

Simple module that adds function: killprocess(“name.exe”)

KillProc VB6 Module

Find the CRC of OBDII Packet VB6

Function FindCRC(Value)
   Dim val(5) As Byte
   value1 = Left(Value, 2)
   value2 = Mid(Value, 4, 2)
   value3 = Mid(Value, 7, 2)
   value4 = Mid(Value, 10, 2)
   value5 = Right(Value, 2)
   val(1) = "&H" & value1
   val(2) = "&H" & value2
   val(3) = "&H" & value3
   val(4) = "&H" & value4
   val(5) = "&H" & value5
   FindCRC = Hex(CalcCRC(val))
End Function

Function for VB6, (place it in a module) to find the CRC of incoming data on the BR-3 OBDII module.