Recent Notes

Displaying keyword search results 1 - 10
Created by voodoo on September 21, 2014 14:54:22    Last update: September 21, 2014 22:29:56
Find out the wireless interface name: # ifconfig I don't know if this helps, but it doesn't hurt: # ifconfig wlan0 up Just to see if wifi works, scan for available wireless networks: # iwlist wlan0 scan Connect (replace SSID with actual id and WIFI_KEY with actual key): # iwconfig wlan0 essid <SSID> key s:<WIFI_KEY> This command failed for me with error: Error for wireless request "Set Encode" (8B2A) : ... The reason being that iwconfig expects a WEP key, but my wifi runs WPA. So, I need to run wpa_supplicant . With no patience to find out how to do it the Ubuntu way, I created a conf file for wpa_supplicant : network={ ssid="example" proto=WPA ... But before running my wpa_supplicant , I...
Created by Dr. Xi on September 23, 2013 09:00:22    Last update: September 23, 2013 09:17:55
Tsung is an open-source multi-protocol distributed load testing tool. It's written in Erlang , but don't let that dissuade you. Here are some simple steps to get started. Install Tsung. On Ubuntu, this is simply: sudo apt-get install tsung . Create a config file ( tsung.xml ): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYP... Beware of the dumptraffic attribute. You might want to set it to false for a real load test. Run the test: $ tsung -f tsung.xml start Starting Tsung "L... Generate the reports: $ cd /home/drxi/.tsung/log/20130923-1031 $ /usr... Open the report file in your browser: file:///home/drxi/.tsung/log/20130923-1031/report.html . For HTTPS testing change the server line to: <servers> <server host="192.168.80.160" port="...
Created by voodoo on September 25, 2012 19:33:02    Last update: June 05, 2013 20:22:50
This a step-by-step example of how to create the files for GNU automake. Put the C source file in directory src ( cat src/hello.c ): #include <config.h> #include <stdio.h> ... Run autoscan to generate configure.scan . Rename configure.scan : mv configure.scan configure.ac Edit autoscan.ac . Update this line: AC_INIT([FULL-PACKAGE-NAME], [VERSION] , [BUG-REP... Add this line after AC_INIT : AM_INIT_AUTOMAKE([foreign -Wall -Werror]) Add this line before AC_OUTPUT : AC_CONFIG_FILES([Makefile src/Makefile]) Create file Makefile.am ( cat Makefile.am ): SUBDIRS = src Create file src/Makefile.am ( cat src/Makefile.am ): bin_PROGRAMS = hello hello_SOURCES = hello.c Run these commands: $ aclocal $ autoheader $ automake --add-miss... The file configure is generated after autoconf is run. Build with: $ ./configure $ make Create tarball for distribution with: $ make dist...
Created by magnum on September 21, 2011 16:01:16    Last update: September 21, 2011 16:02:33
More like assign a second ip address to the same nic, instead of a virtual nic. Multiple IP addresses can be assigned to the same NIC, but all IP addresses must be on the same subnet - otherwise some IP addresses will not be accessible. From command line, assign IP address 192.168.0.2 to alias eth0:0 : sudo ifconfig eth0:0 192.168.0.2 netmask 255.255.2... But IP addresses added this way are not persistent. They are lost whent he OS is restarted. To make the additions persistent: For Fedora: $ su - # cd /etc/sysconfig/network-scripts/ ... The contents of ifcfg-eth0:0 should look like this: DEVICE=eth0:0 IPADDR=192.168.0.2 NETMASK=255... Restart network: # service network restart For Ubuntu: $ sudo vi /etc/network/interfaces Append this to the file: auto eth0:0 iface eth0:0 inet static name Et......
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
Created by freyo on September 07, 2011 16:46:14    Last update: September 07, 2011 19:23:00
The Android unit test framework is based on JUnit 3 , not JUnit 4. Test cases have to extend junit.framework.TestCase or a subclass (such as android.test.InstrumentationTestCase ). Tests are identified by public methods whose name starts with test , not methods annotated with @Test (as in JUnit 4). An Android test suite is packaged as an APK, just like the application being tested. To create a test package, first you need to identify the application package it is testing. Google suggests to put the test package source in a directory named tests/ alongside the src/ directory of the main application. At runtime, Android instrumentation loads both the test package and the application under test into the same process. Therefore, the tests can invoke methods on...
Created by freyo on August 17, 2011 12:29:46    Last update: August 17, 2011 12:29:46
In Android.mk , you can define LOCAL_JARJAR_RULES like this: LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.t... and in jarjar-rules.txt define a rule like this: rule org.bouncycastle.** com.android.@0 The build will change all org.bouncycastle to com.android.org.bouncycastle . Therefore, in your classes which are dependent on the library produced, the import statements should look like: import com.android.org.bouncycastle... Help for the jarjar utility (in prebuilt/common/jarjar/ ): $ java -jar jarjar-1.0rc8.jar Jar Jar Links - ...
Created by woolf on June 18, 2011 21:21:56    Last update: June 18, 2011 21:34:56
I haven't test these. They are collected for reference only. With mencoder, from HOWTO: Convert and write AVCHD (.mts) to DVD with Linux mencoder -oac copy -ovc lavc -of mpeg -mpegopts fo... With HandBrake (GUI): Transcoding AVHD (Cannon HF100 .mts) into a usable open format (MKV w/ FFMPEG) With ffmpeg & WinFF (GUI and command line): How to convert Canon .mts video files to other formats in Ubuntu With mencoder, from Transcoding AVCHD (.mts or .m2ts) files using mencoder on Linux (no deinterlacing): # 1 pass mencoder $file -o ./$file.avi -oac cop... With ffmpeg, from Stuttering playback of canon MTS files #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... #!/bin/bash for i in "$i"*.MTS; do name="${i%.*... With mencoder, from [MEncoder-users] problems with AVCHD (.mts) + Deinterlace...
Created by jinx on April 19, 2011 20:30:20    Last update: April 19, 2011 20:30:20
The PHP constant __FILE__ is the current file name, __LINE__ is the current line number. These can be helpful writing error logs. <?php // __LINE__ is the current line numbe... Outputs: Current file is C:\scrap\test2.php, current line n...
Created by Dr. Xi on March 28, 2011 11:11:33    Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7: # Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Previous  1 2 3 Next