Monthly Archives: November 2010

Running Linux on USB Flash from VirtualBox

See http://www.pendrivelinux.com/boot-a-usb-flash-drive-in-virtualbox/#more-3606 Advertisements

Posted in Uncategorized | Leave a comment

Downsampling MP3 file

#!/usr/bin/tclshset ffmpeg [exec which ffmpeg]puts “ffmpeg = $ffmpeg”if { [llength $argv] < 2 } { puts “\n$argv0 n bps\n” exit -1}set fi [lindex $argv 0]set br [lindex $argv 1]puts “$fi”puts “target $br bps”if { [regexp -all {(.*)\.([mM][pP]3)} $fi a b … Continue reading

Posted in Uncategorized | Leave a comment

PAM Security explained

PAM Security: http://articles.techrepublic.com.com/5100-10878_11-1055269.html

Posted in Uncategorized | Leave a comment

Login restriction/Limitation based on time schedue

This is how to limit a user (in this case, his name is “Joko”) to access computer during weekdays and weekends at certain time duration. Edit file /etc/pam.d/common-account and add a line “account required pam_time.so” Edit file /etc/security/time.conf and add … Continue reading

Posted in Uncategorized | Leave a comment

My First Objective-C

List.h: #import <objc/Object.h>@interface List : Object // List is a subclass of the superclass Object{ int list[100]; // These are instance variables. int size;}/* Public methods */- free;- (int) addEntry: (int) num;- print;/* Private methods *//* Other programs should not … Continue reading

Posted in Uncategorized | Leave a comment

MiniDuckSimulator.java

import java.io.Console;/** * @author mlutfi * */public class MiniDuckSimulator { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Duck mallard = new MallardDuck(); mallard.display(); mallard.performQuack(); mallard.performFly(); Duck model = new ModelDuck(); model.display(); … Continue reading

Posted in Uncategorized | Leave a comment

How to block certain inbound IP addresses

Create a file /etc/iptables/blockip.sh: #!/bin/bash# Simple iptables IP/subnet block script# ————————————————————————-IPT=`which iptables`SPAMLIST=”spamlist”SPAMDROPMSG=”SPAM LIST DROP”BADIPS=$(egrep -v -e “^#|^$” /etc/iptables/blocked.ips)# create a new iptables list$IPT -N $SPAMLISTfor ipblock in $BADIPSdo $IPT -A $SPAMLIST -s $ipblock -j LOG –log-prefix “$SPAMDROPMSG” $IPT -A $SPAMLIST … Continue reading

Posted in Uncategorized | Leave a comment