Posts

Showing posts from April, 2009

Linux/Unix misc

http://linux.101hacks.com bash, profile, sourcing, environment inheritance, et. al. network connection monitoring tcptrack Use the following to avoid coding paths or using environment variables in scripts: BASEDIR=$(dirname $0) Erasing contents of a file with /dev/zero /dev/null /dev/zero Creating a RamDisk List CPUs and types: cat /proc/cpuinfo Filesystem structure Filesystem Hierarchy Standard (FHS) chrontab quick reference LD_LIBRARY_PATH - don't set it, set-uid programs ignore it List linked files ldd Iterate what make install will do: make -n install <makefile> Virtual IP configuration: Unix, Linux, Windows HA failover with keepalived: Linux HA through award-winning 'Failover': Solaris, Linux Load balancing/clustering: Window, Linux Ultra Monkey: load balancing and HA To kill process where pid is in file: backtick replaces command with command execution, see bash programming kill `cat pid.file` Reboot Solaris: shutdown -y -i6 -g0 Solaris lo...

SharePoint as a Wiki

Its a Document Management System for promoting Office. Wiki's facilitate easy, quick, and efficient real-time collaboration. SharePoint Wiki Plus - improved Wiki editor Atlassian SharePoint Connector for Confluence

FireFox 3.0.8 caches more aggressively than Internet Explorer (IE)

When changing the DNS and/or destination of a load balancer, had issues where the content displayed did not represent the new destination. IE updated and showed the correct page, however FireFox had to be restarted in both cases. Neither Ctrl Refresh or opening a new tab resolved the issue. Restarting FireFox fixed the issue in both cases.

HTML, Latin-1, MS uses CP1252 not latin-1

article about HTML, Latin-1 (ISO 8859-1), UTF8, MS uses non-standard superset of ISO 8859-1 (CP1252)

Coding Horror

White space

Ubuntu Compiz Fusion Java 3D issue

This didn't work for me tried putting it in /etc/environment /etc/profile .profile .bashrc Another entry sudo gedit /etc/profile add export AWT_TOOLKIT=”MToolkit” The below didn't work for me with Ubuntu 8.04 and Java 1.6.0_12 Resolution: sudo gedit /etc/environment Add the following below the path line: AWT_TOOLKIT=”MToolkit”

shell scripting

`basename $0` - script name List dir in loop > while true; do clear; ls; sleep 2; done; for jar in *.jar; do echo $jar; unzip -l ${jar} | grep SomeText; done find . -name target | xargs rm -rf Kill all of one type of session Use with care - test grep first ps aux | grep sql | awk '{print $2}' | xargs kill -9

Workflow

Sarasvati Workflow and Enterprise Architect

JSF components

JSF for non believers JSF Central Nice Excadel Fiji components ILog - now IBM Oracle ADF JBoss and Excadel

Java Media Framework - recording and playing audio and video

JMF Java 1.5 Sound Programmer Guide JSAPI Tech Tip JSAPI Demo with Oscilloscope JMF on Ubuntu Setting up JMF on Ubuntu Playing audio clips: Wish I found this first - mindprod.com AboutSound and SoundMonitor, discover and iterate sound capabilities, public domain To play or capture sound using the Java Sound API , you need at least three things: formatted audio data, a mixer, and a line. play and record code example: ibm play audio: developer.com play audio code example: java-tips Sound Accessing Audio System Resources Clip and SourceDataLine Applet MP3 lib JZoom JLayer MPEG-4 & AAC generator/player SDK - IBM Toolkit for MPEG-4 Create content for ISMA and 3GPP compliant devices List of all audio/video type supported JCraft JOrbis Ogg LPGL player

Java Spell Checking

Jazzy Open Source Jazzy example List at mindprod.com jDictionary

Java Text-to-Speech and Speech Recongnition

Spinx-4 Speech recognizer written entirely in Java Java Speech API Programmer's Guide Java Speech API FAQ Processing Speech with Java, developer.com JSAPI O'Reilly JSAPI Introduction FreeTTS

Ubuntu playing non-free media formats

Ubuntu 9.10 HOWTO HOWTO

Eclipse external tools ant build scp

To configure unprompted scp ant task: Install/Create .ssh dir in the home dir with auth_keys or authorized_keys and known_hosts files on xnix server In eclipse external tools ant script config, add ssh library: jsch.0.1.33.jar Copy private key to system with ant/eclipse and point to private key file with ant task google solaris scp without password

Unix stuff

ssh and X11 display bash startup scripts

Flash is king, Silverlight has issues

Flash installed on 99% of browsers Silverlight 25% of browsers - requires admin rights to install ZDNet article

Concurrency / Threading Testing

MultithreadedTC IBM's ConTest GroboUtils' MultiThreadedTestRunner JUnit's ActiveTestSuite

Just google it

Let me google that for you: http://lmgtfy.com/?q=palarva Just google it: http://justfuckinggoogleit.com/

Load Balancing

HAProxy: HAProxy vs Nginx description HAProxy vs Nginx latest graphs HAProxy was simple to setup and configure for sticky sessions and x-forwarded-for source IP pass-through, see HOWTO It was in the Ubuntu Synaptic Package Manager, so it was a click to install. Edited the /etc/haproxy.cfg to configure Started with: sudo /etc/init.d/haproxy [start|stop] Comes with admin stats that by default is on the same balancer front-end address and port, i.e., http://<balancer-address>:<port>/haproxy?stats The docs indicate default is /admin?stats Hot reconfig: ${HAPROXY} -p ${PIDFILE} -f ${CONFIG} ${HAPROXY_OPT} -sf $(cat ${PIDFILE}) # haproxy.cfg file example global log 127.0.0.1 local0 log 127.0.0.1 local1 notice #log loghost local0 info maxconn 4096 #debug #quiet user haproxy group haproxy defaults log global mode http option httplog option dontlognull retries 3 redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 listen eon 0.0.0.0:8282 mod...

Create new VMware Virtual Machine

Installing Windows under Ubuntu with VMware Server

Web 2.0 Performance

The Register - Steve Souders, Google

More readable and maintainable code

Instead of regex: Pattern.compile("\\b\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\b"); Use: "\\b\\p{Digit}{10}\\b" or "\\b\\d{10}\\b" or "\\b[0-9]{10}\\b"