javascript:{ c = document.querySelectorAll("*"); for (var ii=0; ii < c.length; ii++) { var s = c[ii].style; s.background = "ivory"; s.setProperty('color', "black", 'important'); } console.log(); }
Friday, May 12, 2023
light mode bookmarklet
Friday, March 13, 2020
Deleting GNOME's hidden keyboard shortcuts
tl;dr - gnome has shortcuts that are installed by default and not visible in the control center. if setting a shortcut doesn't produce the desired result, it's likely that a hidden shortcut already exists and gnome is ignoring your "redundant" one. which is terrible UI design, but that's another story
to fix the problem, do something like:
gsettings list-recursively | grep "\['
leaving this here mostly as a note to myself for the next time i run into this
Monday, April 1, 2019
LibreOffice unable to select "English (USA)" - spellcheck not working
not sure how common this bug is, but it's tough to track down so documenting it here
symptom:
- spell check fails to find any problems
- "Text Language" shows as "None"
- sometimes other options can be selected, but they don't work and it falls back to "None"
- clicking Style -> Edit Style -> Font -> Language, "English (USA)" is shown as an option, but it doesn't have an "ABC check" icon to the left
the fix:
- make sure hunspell-en-us is installed (that's the ubuntu package name)
- Settings -> Options -> Language Settings -> Writing Aids
- "Hunspell SpellChecker" shows up as ticked
- click Edit
- "Hunspell SpellChecker" shows as not ticked
- tick it
- spelling works
in short, the UI appears to get confused and believes a tool is activated, but clicking edit forces it to reload the true state and you can actually activate it
good luck
Saturday, June 23, 2018
SimpleSSHD with android in 2018
find the IP and MAC addresses for the phone, and on the desktop run:
- arp -s 192.168.xx.xx yy:yy:yy:yy
Monday, March 5, 2018
list locally installed maven dependencies
on my development machine i'm actively working on perhaps 20 inter-dependent maven projects, most of which get published to ossrh from time to time, and i also depend on many other projects from maven central i'd like to list the dependencies that have been installed locally as opposed to those that have been downloaded from a repository. i'm aware that mvn -U will check remote repositories for snapshot dependencies, but in many cases my versions aren't -SNAPSHOT is there a way to tell which dependencies have been installed locally ?user JF Meier made the critical observation in a comment that there's a _remote.repositories file in the local repository. based on this, i came up with the following:
versions=$(mvn dependency:list -DoutputAbsoluteArtifactFilename -DoutputFile=/dev/fd/2 2>&1 1>/dev/null | grep -o "/.*/" | xargs -Ixxx grep -L "jar>central=$" xxx_remote.repositories) | grep -o ".*/"and then i use that to copy the local artifacts to a remote machine for testing:
rsync -aRvO $versions example.com:/
caveat emptor - the file format isn't a public api and includes the following
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
Tuesday, January 30, 2018
load a java class with a different parent classloader
public static void demoJailbreak() throws Exception {
ClassLoader parent = Thread.currentThread().getContextClassLoader();
String jre = System.getProperty("java.home");
String jdk = jre.endsWith("/jre") ? jre.substring(0,jre.length()-3) : jre;
JavaCompiler broken, byPath=null, compiler;
try {
byPath = (JavaCompiler) loadByPath(
"com.sun.tools.javac.api.JavacTool",
"file:" + jdk + "lib/tools.jar",
parent
);
}
catch (Exception ex) {}
compiler = ToolProvider.getSystemJavaCompiler();
broken = (JavaCompiler) jailbreak(compiler.getClass(),parent);
System.out.println("jailbreak : " + broken);
System.out.println("loadByPath: " + byPath);
}
/**
* create a new instance of a class
* using a new url classloader with a specified parent
* and the same resource path as the original class instance
*/
public static Object jailbreak(Class klass,ClassLoader parent) throws Exception {
String cname = klass.getName();
String path = getPathForClass(cname,klass.getClassLoader());
Object dup = loadByPath(cname,path,parent);
return dup;
}
/** return the path at which an original classloader finds a class at */
public static String getPathForClass(String cname,ClassLoader orig)
throws Exception {
String rname = cname.replace(".","/") + ".class";
java.net.URL url = orig.getResource(rname);
String full = url.getPath();
// need to split the jar url on an exclamation mark per:
// https://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html
String path = full.split("!",0)[0];
return path;
}
/**
* create a new instance of a class by name
* from a new classloader using a file:/path/to/jar style path
* and the designated parent
*/
public static Object loadByPath(String cname,String path,ClassLoader parent)
throws Exception {
java.net.URL url2 = new java.net.URL(path);
java.net.URL [] urls = new java.net.URL [] {url2};
ClassLoader cl = new java.net.URLClassLoader(urls,parent);
Class klass = cl.loadClass(cname);
return klass.newInstance();
}
all static methods, no maven dependencies and shouldn't require importing anything, so cut and paste should work. note: this example will only work if you have a jdk installed (the compiler isn't in the jre), and the byPath version will only work if the jre path is "jdk_path/jre". that said, the jailbreak and loadByPath will work fine anywhere
Thursday, January 25, 2018
Integrating Spring with a legacy app
To inject a non-spring POJO into a Spring Boot application:
- create an ApplicationListener
- in the listener call registerSingleton with the non-spring object
- register the listener with the app
this allows the field to be initialized early during the application lifecycle
@RestController
@SpringBootApplication
public class SpringLegacy {
public SpringLegacy() {}
@Lazy
@Autowired
@Qualifier("legacyBean")
Object myBean;
@RequestMapping("/dir")
public Object dir() {
return "hello world " + myBean;
}
static class LegacyObject {}
public static void main(final String[] args) throws Exception {
Object obj = new LegacyObject();
SpringApplication app = new SpringApplication(SpringLegacy.class);
ApplicationListener lis = new ApplicationListener() {
boolean first = true;
@Override
public void onApplicationEvent(ApplicationEvent event) {
if (first & event instanceof ContextRefreshedEvent) {
((GenericApplicationContext) (((ContextRefreshedEvent) event).getApplicationContext())).
getBeanFactory().registerSingleton("legacyBean", obj);
first = false;
}
}
};
app.setListeners(Arrays.asList(lis));
app.run(args);
}
}
full source is https://github.com/nqzero/spring-legacy
run the maven project, and then browse to localhost:8080/dir - you should see "LegacyObject" in the output
Thursday, November 16, 2017
java reverse proxy for websockets
https://github.com/nodejitsu/node-http-proxy
but with java it's proven much more difficult to find. just found this:
https://github.com/barrett-rob/java-websocket-reverse-proxy
haven't tried it, but looks like it will work
Saturday, February 13, 2016
save bash history remotely by sending a signal to all interactive bash
a problem that i run into every few months is i've solved a problem on one machine, but haven't yet exited from the shell so the solution is not stored in the history file yet. and i'm at a remote location, so i can't run "history -a"
solution
add the following to .bashrc
# safely append the bash history
function .save_hist {
exec 200<${HISTFILE}
if flock -w 5 200; then
history -a
flock -u 200
echo "SIGHUP received, history file saved"
else
echo "SIGHUP received, but lock failed, history not saved"
fi
exec 200<&-
}
trap '.save_hist' HUP
# signal all bashes
function save_hist {
# not no tty and user and bash
(ps h -o pid -Nt - | sed "s/ //g"; pgrep -u "$USER" bash) | sort | uniq -d | xargs kill -HUP
}
to use it, ssh into the machine and run "save_hist"
Note: this is semi untested and has the potential to kill background process (the ps arguments aren't documented perfectly). but it appears to work
Note: *all* shells to have been started since the bashrc change to work
how it works
i wanted to use SIGUSR1, but bash doesn't appear to trap that signal until the user presses enter. which defeats the purpose. SIGHUP isn't really intuitive, but it is used by some daemons to reload their config file, which is somewhat along the same lines. and afaict, interactive bash doesn't use SIGHUP for anything. i'm open to other suggestionstrap is used to catch the HUP signal and then run "history -a". i use flock since it's not clear that bash handles simultaneous saves safely, and i routinely have dozens of bash tabs open.
you can use kill directly to send the signal, but i wanted to be able to save all the active interactive shells. i couldn't find an easy way to list them, so i came up with listing everything with a tty, combining that list with the users bash instances, filtering for only duplicates, and passing those PIDs to kill. it seems to work
good luck, and let me know if you have any problemsalternatives
i posted this on [/r/bash](https://www.reddit.com/r/bash/) and got downvoted as usual. but [lihaarp](https://www.reddit.com/user/lihaarp) pointed out that you can set PROMPT_COMMAND. this saves the history after every command. i prefer my approach as it saves each bash instance in order, but it does mean you risk losing history if the computer crashes. ymmvSunday, January 31, 2016
vertical inches matter - 16:10 or better (3:2, 4:3) laptops, ie "real laptops" or "business laptops"
business laptops are generally pretty solid - tons of options for cpu, pixel density, memory, storage, graphics. but there's very little choice when it comes to aspect ratio - the vast majority of laptops for sale today (jan 2016) are 16:9. this translates to very short screens that are great for watching movies, but just aren't useful for doing real work. in the hopes of encouraging sales, and hence production, of real business laptops, i'm going to maintain a list
- HP spectre x2 - windows 10 convertible, 3:2, 12", core m, $800 (m5 6y54, 8gb, $950)
- Lenovo miix 700 - $750, m3-6y30, 4GB ram, 64GB ssd, 12", 3:2
- ipad pro - 4:3, 12.9", A9X cpu, 32GB, $800
- macbook pro 13 retina - $1300, 13.3", 16:10, i5, 8GB ram, 128GB ssd ($1100 non-retina)
- macbook air 13 - $1000
- surface pro 4 - $900, 12", 3:2 aspect ratio
- surface book - 13.5", 3:2, $1500
- chromebook pixel - 3:2, 13", i5, 8GB ram, 32GB SSD, $1000 (i7/16/64/$1300)
- samsung ATIV book 9 - 12.2", 16:10, 4GB ram, 128GB ssd, core m 5y31, $1300
- panasonic CF-SZ5 - 12.1", 16:10, core i5, 8GB ram, 128GB ssd, $1400 (in japanese, so i'm guessing)
- panasonic toughbook - more of a bulldozer replacement than a desktop replacement
- Hp Pavilion X2 12 - 12" 3:2 1920x1280, Core M 4GB, convertible, $600
- Thinkpad X1 Tablet - 12" FHD+ 2K (2160 x 1440) IPS, 3:2 - Core M - up to 16GB Ram - $999+(?) not yet released
Tuesday, January 19, 2016
accessing the command line in java
would be convenient to be able to define a main() in an abstract superclass and have it automatically "run" the subclass that java was invoked with. there's nothing builtin, but at least on linux this info is easy to get. here's a simple demo
import java.nio.file.Files;
import java.nio.file.Paths;
public static void main(String[] args) throws Exception {
// linux only, might work on windows
// https://cygwin.com/ml/cygwin/2007-04/msg00817.html
byte [] bytes = Files.readAllBytes(Paths.get("/proc/self/cmdline"));
String [] text = new String(bytes).split("\0");
String klassname = text[text.length-1-args.length];
System.out.println(klassname);
}
if anyone tries this on windows, leave a comment if it works
Wednesday, January 13, 2016
Asynchronous Java webserver "Hello World" baseline
- is implemented in java and uses java methods (and lambdas) as the query language
- uses the Kilim fiber library for high concurrency, ie imperative code is transformed into coroutines
- is initially targeting low-end boxes, eg a VPS with limited cpu and memory resources, rentable for approximately $5 a month
- is targeted at java developers that don't want the complexity of an enterprise environment
- Jetty blocking
- Undertow blocking
- Jetty Async (servlet)
- Kilim Async - a simple http server that's part of the library
- Comsat Async - a Quasar (another fiber library) shim that integrates with a Jetty servlet
- Undertow Async (native)
source code for the embedded servers and some scripts used for testing:
https://github.com/nqzero/jempower
Async:
Results:
the chart below shows the concurrency sweep. the left axis is median requests per second, the right is max (over 3 sweeps) failures. at 20000, undertow-async is all over the place, so don't read too much into the specific number (see the discussion below). here's an interactive version of the chartDiscussion
Jetty performance, for both blocking and async, was a very nice middle ground - decent low-concurrency performance and a graceful falloff at higher levels. the cost of using async was about 15% across the range (at lower concurrency my async implementation sleeps a little too long to saturate the connection, but that's an artifact of the highly artificial use of async)
Comsat added a substantial overhead on top of async Jetty, and exhibited some failures at high concurrency. i've tried several different implementations based on the documentation and code from TEBM, and all performed about the same
kilim performance was competitive with Jetty, especially at high concurrency and kilim has some nice properties - true fibers (like comsat) so handlers are simple to write, the server itself is fiber-based (unlike Comsat) so blocking IO isn't a problem (async IO can be used in Jetty, but is a pain). however, the server is fairly primitive feature-wise, so at the least another server would be needed to proxy it. i have a working integration with my database that's very elegant, and i'll keep that, but want to add a more versatile server as well
Conclusions
- Kilim offers competitive performance and the advantages of a true fiber-based server
- Jetty Async offers a good mix of features, performance, and ease of use
- Comsat performance was underwhelming, but the ability to shim fibers with servlets isn't (i haven't looked at the source, but my understanding is that it's a pretty simple and elegant hack) and i may investigate using Quasar in my database
- undertow seems very capable, but isn't accessible to non-experts (or at least, not to me)
Caveats
- i'm not an expert
- ApacheBench doesn't rate-limit connections, so the results aren't necessarily apples-to-apples (ie, faster servers get worked "harder")
- at least the undertow handlers could saturate ApacheBench at low concurrencies, and running a second instance of AB increased throughput (120000 requests per second). not the focus of this study, so the results above use only a single AB
- pull requests are welcome (though part of my need is for my demo to be easy for potential users to understand, so i probably won't integrate solutions that greatly increase complexity)
Friday, January 8, 2016
sudo absolute path within script - bash, linux, ubuntu
- sudo: cmd_on_my_path: command not found
this is counter-intuitive, but i guess makes sense if i think about it enough - sudo only sees the command name, not the full path, and presumably for security they don't want to respect $PATH
but in the case in which the user has full sudo rights, i don't see how this helps anything. so in my script i've replaced "sudo myCommand" with:
- sudo "$(which myCommand)"
Tuesday, December 29, 2015
caffeine, theobromine and theophylline content of coffee, tea and chocolate
http://www.caffeineinformer.com/caffeine-content/coffee-beans
hershey's cocoa powder, per T (5g powder): 8.4 mg caffeine, 106 mg theobromine
espresso, 1.5oz shot (7g beans)
starbucks drip coffee, 8oz: 165 mg caffeine
coffee beans: 6 mg per bean (300-330 mg, from wp)
used coffee grinds: 41mg per 7g of beans used, 4-8 mg per g (depending on method)
8oz brewed coffee (amount of bean unspecified): 145 mg drip, 108 mg french press
black tea, 8oz liquid (1 tea bag): 42 mg, 55mg for lipton, 4g theobromine (WP:tea)
yerba mate, 8oz: 85mg
wikipedia:
caffeine metabolites:
- Paraxanthine (84%): Increases lipolysis, leading to elevated glycerol and free fatty acid levels in blood plasma.
- Theobromine (12%): Dilates blood vessels and increases urine volume
- Theophylline (4%): Relaxes smooth muscles of the bronchi, and is used to treat asthma. The therapeutic dose of theophylline, however, is many times greater than the levels attained from caffeine metabolism
- this is twice what CI says for cocoa
Thursday, December 24, 2015
at&t mvno "pay as you go" data plans
- data on a per MB basis
- low monthly costs
- AT&T network
- willing to buy in $100 increments
- byod
- plan info available in english
wikipedia maintains a list and i went thru each entry for AT&T, and also googled a bit - ignoring plans with high per month minimums (ie if an operator didn't offer a plan under $30 per month they're not listed here). plans / prices as of december 24, 2015:
- h2o - $100, 1 year service, 5¢ per min or sms, 10¢ per MB or mms
- black - $100, 1 year service, 5¢ per min or sms, 10¢ per MB or mms
- tracfone - $140 per year for service/voice, plus 1.5¢ per MB, terms are somewhat confusing
- consumercell - $10 per month service, plus $10 per month for 500 MB, additional data at 25¢ per MB, means that effectively you need to pre-purchase data (uses T-mobile too)
- airvoice - $30 per 5 months, $1 per month, 10¢ per min/sms/mms, 6.66¢ per MB
- at&t - go phone, $2 per day but claims (unconfirmed) only charged if voice/sms is used, $1 per 100 MB
- jolt - $15 per month for service/30MB, additional data at 50¢ per MB
and for t-mobile:
- ting - billing is confusing (buckets), could do data-only for $6 per month service, plus $12 for 500 MB (next bucket is $19 for 1 GB)
- campus - sketchy, $25/month includes 500 min, unlimited sms, 500 MB. details lacking
- tempo - $70, 1 year service, 7¢ per min or MMS, 2¢ per sms, 14¢ per MB
- lyca - $19 per month, unlim voice/sms, 100 MB data, not clear if you can buy more data
- net10 - not clear that any "cheap" plans include data
- proven - confusing, $25 per month includes 750 min, 250 sms, 100 MB
ptel - $60 per year service, 5¢ per min, 2¢ per sms/mms, 10¢ per MBout of business- simple - $20 per month data-only, includes 1.5 GB
- ultra - $19 per month, unlimited talk/text, 100 MB (not clear if you can buy more)
- usmobile - $16 per month, including 1 GB (talk+text is extra, but reasonable)
took a look at verizon:
- callmr - $17 per month including 500 MB, plus 5¢ per min/sms/MB (or $20 for 1 GB)
- pageplus - 50¢ per month, plus 5¢ per min/sms, 10¢ per MB (cannot activate 4g device)
- envie - $25 per month, includes 500 min, unlim sms, 1 GB (lte)
Friday, September 4, 2015
dynamic DNS on DD-WRT won't update after power up / boot
Thu Jan 1 00:00:50 1970: INADYN: Started 'INADYN Advanced version 1.96-ADV' - dynamic DNS updater.
Thu Jan 1 00:00:50 1970: INADYN: IP read from cache file is 'xx.xx.xxx.xx'. No update required.
Go to: Administation-> Management
In Additional Cron Jobs write:
*/10 * * * * root /usr/sbin/inadyn /tmp/ddns/inadyn.conf > /dev/null 2>&1
i ended up disabling the cron job years ago, i believe because i was worried about the logs filling up memory. or perhaps because it resulted in multiple inadyn processes running. at this point, i'm still not sure if it ever really (since the problem is so intermittent) worked
i just disabled the external ip check
but i understand the fundamental issue better now than i have. inadyn is running, but failing to recognize that the cached value differs from current value. there's a verbose option for the config file, but i don't currently have it enabled (the UI doesn't have an option for it). i believe that there's a way to use the nvram tool to manually fix it, ie without the UI, but i haven't delved into it yet
good description of how to force inadyn to restart shortly after booting (to allow it to pick up the correct ip address):
https://www.dd-wrt.com/phpBB2/viewtopic.php?p=70161
an unrelated issue is that the sshd running on the router only supports a no-longer-current encryption method and ssh by default refuses to connect, so need to use a workaround
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@192.168.11.1
Monday, April 20, 2015
a tale of two tunnels, in which iptables proxies a bridge
- genymotion
- running on virtualbox
- running on an ubuntu linux host
- redirected thru a transparent proxy on the host
- routed thru an ssh tunnel to a remote server (nqzero.com in the examples)
- iptables based masquerade for NAT
on both the host and the remote machines:
- sudo cp ~/.ssh/authorized_keys /root/.ssh
- set in /etc/ssh/sshd_config
- PermitTunnel yes
- PermitRootLogin without-password
- echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
- sudo iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE
- sudo iptables -A FORWARD -i venet0 -o tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
- sudo iptables -A FORWARD -i tap0 -o venet0 -j ACCEPT
- sudo ifconfig tap0 192.168.0.1 netmask 255.255.255.0 up
on the host:
- ssh -C2qTnN -D 8082 nqzero.com
- sudo ssh -i ~/.ssh/id_rsa -o Tunnel=ethernet -f -N -w 1:0 root@nqzero.com
- sudo ssh -i ~/.ssh/id_rsa -o Tunnel=ethernet -f -N -w 0:2 root@localhost
- sudo brctl addbr br0
- sudo brctl addif br0 tap2
- sudo brctl addif br0 tap1
- sudo iptables -t nat -A PREROUTING -i br0 -p tcp --dport 80 -j REDIRECT --to-port 8888
- sudo iptables -t nat -A PREROUTING -i br0 -p tcp --dport 443 -j REDIRECT --to-port 8888
- proxychains mitmproxy -p 8887
- proxychains mitmproxy -T --host -p 8888
- sudo ifconfig tap0 0.0.0.0 up
- sudo ifconfig tap1 0.0.0.0 up promisc
- sudo ifconfig tap2 0.0.0.0 up
- sudo ifconfig br0 192.168.0.5 netmask 255.255.255.0 up
- adapter 1: unchanged (host-only, vboxnet0)
- adapter 2: bridged adapter, tap0
genymotion.android.settings.wireless.proxy: 192.168.56.1, 8887
my intuition was i could have virtualbox bridge directly to br0 (and omit the local tunnel entirely). packets got sent to the remote tunnel correctly, but i couldn't get iptables to redirect them, so i added the local tunnel. at that point, iptables was pulling the packets from the bridge, but not routing them anywhere, they just silently disappeared. to fix that, i added the bridge IP and zeroed out the tunnel endpoint IPs, and everything worked (i read this advice several places, but don't understand why it works)
i use 2 proxies, both of which pass data over the ssh connection to port 8082
- 8887 port uses the proxy mechanism provided by android
- 8888 is a transparent proxy to catch anything else (i'm trying to document an api)
- monitor with: sudo tcpdump -vvvnni tap1
- nothing should leak out thru the local network
- must be 1 (ubuntu default): /proc/sys/net/bridge/bridge-nf-call-*
over the bridge and through the two tunnels
to genymotion's house we go
iptables knows the way to proxy the packets
thru the virtual and private network
Sunday, June 8, 2014
java apidocs for websockets
for tomcat 8, netbeans 8 and the websocket and servlet stuff:
- download the websocket apidocs from
- http://download.oracle.com/otndocs/jcp/websocket-1_0-fr-spec/index.html
- currently called javax.websocket-api-1.0-apidoc.zip
- download the servlet apidocs from
- http://download.oracle.com/otndocs/jcp/servlet-3_1-fr-spec/index.html
- currently called javax.servlet-api-3.1-final-javadoc.jar
- in netbeans -> tools -> servers -> tomcat 8 -> javadocs, add the apidocs.zip (or jar) files
- apidocs for standards should be liberally licensed
- this is "embrace, extend and extinguish" in all it's glory
- websockets and servlets don't belong in javaEE, they're standard web technologies
Wednesday, June 4, 2014
netbeans "package does not exist" error -- maven considered harmful
package XXXXX does not existin this case XXXXX was a package provided by another netbeans project. it does indeed exist, the jar is being built properly and compiling the "broken" project succeeds and the application runs. so this is purely a problem with netbeans parser / indexer. i tried removing the dependency and re-adding it, cleaning and rebuilding, and exiting netbeans, removing the cache and restarting. nothing helped
looking thru messages.log, i see
WARNING [org.netbeans.modules.java.source.indexing.JavaIndex]: Ignoring root with no ClassPath: /home/YYYYY/working/nq0/XXXXX/XXXXX.git/srcdidn't find much mention of that warning on the interwebs. looking at the "project properties" page for the project i realized i'd seen this problem before and started fiddling
the problem is that buried in the XXXXX directory, there's a pom.xml. netbeans detects this and somehow modifies how the project is managed. it's a "project with existing sources", not a maven project. but somehow netbeans fails to honor that when it finds a pom.xml
my solution was to deactivate the maven plugin (why that gets installed in the first place is beyond me). which eliminates the issue (i reactivated it temporarily to verify that that was actually the problem). this happened when i upgraded to netbeans 7, and i'm sure this will happen again when i upgrade to 8
maven is terrible, and the plugin makes it worse. it's the wrong metaphor for managing dependencies
Ivy Bridge integrated graphics corruption, small groups of braille-like dots, giving a snow-like appearance
at first, the problem was manageable - the dots rarely obscured what i was reading and the machine never crashed. i wasn't sure if the problem was hardware or something that ubuntu was doing, so i lived with it and in some ways even liked it, in a "ghost in the machine" sort of way. but over the next year the problem got somewhat worse and at this point the problem had persisted thru several ubuntu versions (including a clean reinstall that i'd done for the sake of seeing if some configuration change i'd made was part of the problem), so i was forced to track down the cause
i "live chatted" with intel support and they told me to run the intel processor diagnostic tool. the standard tool is windows-only, but they include a link to a fedora15-based liveUSB version. the instructions seemed cryptic to me, the utilities were ".exe"s, possibly directed to windows users (though why they wouldn't just use the standard tool ???) and the intel support team stated:
Alberto: the thing is that we are not that familiar with Linux
so they were useless. tl;dr - it took me (much) longer than it should have to run the tool. but eventually i got it running, the "snow" still appeared (ie, the fedora15 system exhibited the glitch), but the tool reported that all tests passed, ie the tool was useless (it didn't verify that the generated images matched the desired values). fwiw, here's the easiest way i found to use the tool:
- download the iso (eg, this one)
- i'll call it ipdt.iso for simplicity
- insert a usb drive (i'll call this /dev/sdX)
- we're going to overwrite the drive, so *all data* on it will be lost
- if it automounts, unmount it
- in my case, it was recognized as /dev/sdd
- dd bs=4M if=ipdt.iso of=/dev/sdX
- insert the usb drive into the target computer and boot from it
- most modern systems support boot-from-usb. if yours doesn't, maybe you could burn a cdrom ???
- fedora should boot up
- open up a terminal and type (for a 64bit system)
- install64
- click the "ipdt" icon on the desktop
- Standard Warranty Replacement: This is when you send the processor first to us, and then once we receive it, it takes 5-8 business days for you to receive the replacement processor.
- Advance Warranty Replacement: This is when we send you the processor first, and then, once you receive it you just need to send your defective processor back to us. There is a fee on this option, $25, not refundable, that covers the overnight shipment of the processor to you, and also it covers the shipping for you to send the defective processor back to us. And also for security reasons, we are going to charge the price of the processor to your credit card, just in the meantime, as soon as we get your defective processor we will do a refund for that amount.
Friday, March 14, 2014
books to read next 2014 edition
Monday, March 3, 2014
ubuntu 13.10 + unity + libreoffice mnemonics == FAIL
This ubuntu bug report has been open for 3 years with no progress. At various times, mnemonics have worked briefly with some magic ever changing invocation, perhaps installing lo-menubar or some specific version of LO not in the repository. The bug report is labeled "High Priority", but is Unassigned (does that mean "high priority to no-one"). With 13.10 i don't believe that there is any way to make the unity integrated menus work correctly. There is some chatter online that 14.04 will bring menu bar sanity, but i haven't seen anything explicitly mentioning mnemonics
The LibreOffice bug report is closed as NOTOUTBUG, because someone once heard that someone else thought it was a generic Gnome problem. no link to another bug report, roadmap to a fix, no comment from the 2nd hand source, nothing. way to take responsibility. though in general, i'm all for blaming Gnome because *fuck those guys* for forcing gnome-shell on us and it probably is their fault
The workarounds that are proposed are
- uninstall unity
- apt-get purge libreoffice-gtk, which leaves a horrid 1995-style interface with broken window manager support (ie, you can't maximize the windows), menu bars that don't render correctly, and a propensity to lose access to the keyboard requiring a restart
I haven't tried the first option - it seems pretty drastic since unity is the *recommended* way to use Ubuntu. I'm more inclined to switch to Mint, but that too seems pretty drastic. The second option is completely unusable (and i've tried multiple versions and sources of LO). My current approach is to purge libreoffice and install openoffice (untar and dpkg -i *.deb). OpenOffice seems usable
Evince and some other apps have shown similar issues, but so far i've managed to live with them. Maybe one of them will eventually force me to Mint or to uninstall Unity
tl;dr
As shipped, Ubuntu 13.10 doesn't have a usable office suite, which is one of their key features. I can understand Free Software being buggy, but the false advertisement of claiming things are working is bullshit
Get things done
I guess they don't mention "use a keyboard". Assholes
Friday, January 31, 2014
ubuntu 13.10 libreoffice menubar lossage
freedesktop calls it "NOTABUG", ubuntu doesn't seem interested in fixing it (no-one is assigned after almost 3 years), and anyone that posts on askubuntu gets closed as "offtopic" with a snarky comment. for now, the options available are:
- uninstall libreoffice-gnome, leaving an ugly interface that doesn't maximize correctly
- uninstall libreoffice entirely using apt and install the package from freedesktop.org (or maybe from a ppa) ... i haven't verified that this works, but there are some reports that it does
Tuesday, January 14, 2014
Monday, October 21, 2013
lightdm invalid session - screen blanks and greeter restarts
in the process of reinstalling ubuntu raring 13.04 (or possibly during the initial upgrade to 13.04 from 12.10) lightdm got confused. it would display the greeter, i'd provide my password and then it would attempt to start my session, ie the screen would go momentarily black. but instead of starting unity, it would fail and restart the greeter. i don't have any of the old logs, but i believe the message was to the effect of "invalid session: xterm". (i believe that i set this session fucking around with settings, but it could also have been an valid session that has since been deleted - when i reinstalled i omitted many packages)
the greeter didn't give an option to choose a session, so i had to talk to dbus directly (which may very well be how i got in trouble in the first place:)
# list the sessions (ignore the .desktop suffix)
# note: they might not all be valid, eg because the software hasn't been installed
ls /usr/share/xsessions
# get the dbus name for the current user
user=$(dbus-send --print-reply=literal --system --dest=org.freedesktop.Accounts /org/freedesktop/Accounts org.freedesktop.Accounts.FindUserById int64:$(id -u))
# set the session (replace ubuntu with another valid session if desired)
sudo dbus-send --print-reply --system --dest=org.freedesktop.Accounts $user org.freedesktop.Accounts.User.SetXSession string:'ubuntu'
lightdm should really provide a means to select your profile. by default, it doesn't if there's only one valid session. however, the session that it uses is the "current session", ie the one that it gets from dbus, which might not be the valid session. little bit of catch-22. in theory, i should submit a bug report. in reality, canonical will sit on it for 7 years regardless, so fuck em
Friday, September 20, 2013
clone root partition via rsync (to handle 512 vs 4k sector size)
mount /dev/sdc1 /mnt
# -x limits rsync to a single partition
rsync -avxHSAX / /mnt/
for ii in /dev /dev/pts /proc /sys /run; do sudo mount -B $ii /mnt$ii; done
sudo chroot /mnt
grub-install --recheck /dev/sdc
update-grub
# label the partition for use in fstab
e2label /dev/sdc1 mylabel
blkid -c /dev/null
gedit /mnt/etc/fstab
the error messages are somewhat cryptic. from syslog:
ata2.00: exception Emask 0x0 SAct 0x4 SErr 0x0 action 0x0
ata2.00: irq_stat 0x40000008
ata2.00: failed command: READ FPDMA QUEUED
ata2.00: cmd 60/08:10:d7:00:19/00:00:0b:00:00/40 tag 2 ncq 4096 in
res 51/40:08:d7:00:19/00:00:0b:00:00/40 Emask 0x409 (media error)
ata2.00: status: { DRDY ERR }
ata2.00: error: { UNC }
ata2.00: configured for UDMA/133
sd 1:0:0:0: [sda] Unhandled sense code
sd 1:0:0:0: [sda]
Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 1:0:0:0: [sda]
Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
0b 19 00 d7
sd 1:0:0:0: [sda]
Add. Sense: Unrecovered read error - auto reallocate failed
sd 1:0:0:0: [sda] CDB:
Read(10): 28 00 0b 19 00 d7 00 00 08 00
end_request: I/O error, dev sda, sector 186187991
ata2: EH complete
and fsck shows some errors, eg "Attempt to read block from filesystem resulted in short read" and some unattached inodes
using rsync to clone
installing grub via chroot
Friday, April 12, 2013
MapDB (aka jdbm3++) first look
looks promising, but not the holy grail
CONS: appears to require a max size on keys. kind of a pain to setup. examples and benchmarks appear very simple. believe it's using mmap (which is fundamentally limited). appears to be a single thread for writes and a thread per read ???
PROS: appache2 license, java interface
i didn't investigate the internals much, in particular the mvcc
Thursday, April 4, 2013
ubuntu 12.10 unity ivy bridge visual glitch
anyone seen anything similar ?
update: if i leave glxgears running in the background the patter disappears and doesn't come back. also found an *old* post about something similar
Monday, March 18, 2013
webstorm 6 lossage
the best indication that the language model is working is that for a js file that's been properly jsdoc'd
- for prototype methods, webstorm displays up and down arrows in the left margin which list (and navigate to) the super and subclass method implementations
- for most method calls, 'go to declaration' navigates to the correct method (as defined by the jsdoc comments)
- 'find usages' and 'rename'
- list method calls in any object with the same method name
- should filter by reverse mapping (ie, the one that 'go to declaration' uses)
- don't have the option to sort by order in the file - iterating the list results in a non-monotonic walk of the documents
- ignore method implementations with the same name in sub and super classes, ie methods that are overridden or override
- should find (or have the option to find)
- rename *must* rename all implementations and causes hard to track down issues when it doesn't, ie it loses the relationships that the model had established prior to the rename (thank god for git)
- 'go to super method' does nothing (same mapping that is used to provide the up arrow in the margin should be used)
- no easy way to type unicode characters (in most apps on ubuntu, control+shift+u captures a unicode hex value, eg ᵩ is u+1d69)
- display of unicode characters using a monospace font aren't monospaced, eg:
- macros suck, eg scrolling up or down 10 lines is very slow and problematic
Thursday, March 14, 2013
the genius of unicode in javascript identifiers
i've used recent versions of webstorm (jetbrains javascript IDE) and netbeans, and older versions of eclipse and a few others. and i've googled and read extensively - as far as i can tell webstorm has the best support for javascript code understanding (netbeans used to be a close 2nd, but the latest nb7.3 version has been a step backwards and ws6 is a step forwards - leaving a gap)
but even in webstorm it sucks. for the most part 'find usages' just does a text search - it can't distinguish between 2 methods with the same name in unrelated prototypes, even in the simplest cases with enough jsdoc annotations to make it unambiguous. 'go to declaration' works some of the time, but still fails often in cases where plenty of information is available
i spent some time submitting bug reports, trying new IDEs, annotating extensively with jsdoc, refactoring my code to be easier to parse, etc. to little effect and i've ultimately accepted that the only way to be able to reliably navigate in javascript code is by using unique indentifiers
i tried a number of schemes
- long java-style names, eg setDayOfWeek
- various prefix schemes using the same prefix for all methods in a prototype, eg for the ViewDiary prototype i might have vdSet and vdMerge or vd_set and vd_merge
- various suffix schemes similar to the prefixes
/**
* state representation of a nu.FoodList
* @constructor
* @augments nu.Stateᵧ
*/
nu.Stateᵧ.Listᵧ = function() {
this.replyᵧ = null;
this.termᵧ = null;
this.startᵧ = 0;
this.kfoodᵧ = 0;
this.derivedᵧ = false;
this.jumpEndᵧ = false;
};
nu.Stateᵧ.Listᵧ.prototype = {
setᵧ: function(term,start,kfood) {
this.termᵧ = term;
this.startᵧ = +start || 0;
this.kfoodᵧ = +kfood || 0;
return this;
}
};
they're easy to read, compatible with completion, and easy to keep unique. both webstorm and nb7.2 handle them elegantly - find usages and go to declaration work great. the downside is that they're a pain to type without completion (i copy/paste)
unfortunately, chrome devtools won't do completion with object properties that contain non-ascii characters. firebug works fine
Note: not all unicode characters are valid in javascript identifiers, here is one validator
update - bash support
by default my inputrc (ubuntu 12.10 with gnome classic) doesn't appear to support unicode copy or paste, ie bash doesn't work !!! i needed to enable support for meta characters ...echo "
set input-meta on
set output-meta on
set convert-meta off
" >> ~/.inputrc
bind -f ~/.inputrc
most of the ubuntu apps, eg gnome-terminal and gedit, appear to support typing unicode characters with shift+control+u followed by the hex value of the character and space or enter. unfortunately, neither webstorm nor netbeans support this interface, meaning you need to copy and paste the character from some program that does support them, eg the gnome character map
for a full list of the unicode characters, install the ubuntu unicode-data package or download the raw list
Tuesday, February 12, 2013
stormvz virtual private server
purchase and the initial setup were painless. but actually getting anything done has been challenging. it comes with ubuntu 12.04 and runs openvz. the base install seems mildly broken. out of the box, sudo doesn't work, maybe i'm just supposed to use root for everything ?
NOTE: replace XXXXXX, YYYYY.YYY and ZZZZZ with the password, domain name and username respectively as root on the VPS:
useradd admin
useradd -m -s /bin/bash ZZZZZ
usermod -a -G admin ZZZZZ
chmod u+s /usr/bin/sudo
passwd ZZZZZ
apt-get update
apt-get dist-upgrade
apt-get install mysql-server
mysql -p --user=root
# GRANT ALL ON *.* TO ZZZZZ@localhost IDENTIFIED BY 'XXXXXXX'
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
from my normal machine:
scp .ssh/id_dsa.pub YYYYY.YYY:
scp -r .bashrc .bash_profile .bash_logout YYYYY.YYY:
scp hackpath hackpath-setup interactive-shell path-setup YYYYY.YYY:.bash
as ZZZZZ on VPS:
mkdir .bash
mkdir -p .ssh/keys
cat id_dsa.pub >> .ssh/authorized_keys
mv id_dsa.pub .ssh/keys/takashi.pub
sudo apt-get install tomcat6 nano tomcat6-admin
sudo apt-get install openjdk-7-jdk
sudo update-alternatives --config java
sudo nano /etc/tomcat6/tomcat-users.xml
#
#
#
sudo nano /etc/defaults/tomcat6
# JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
i wanted a recent java and had trouble installing - the download required cookies and javascript, couldn't figure out how to make lynx work with it (text mode only on the server). so got the download link in the chrome developer tool on my desktop and used wget on the server (obv the auth param isn't good any more)
wget "http://download.oracle.com/otn-pub/java/jdk/7u13-b20/jdk-7u13-linux-x64.tar.gz?AuthParam=1360726523_769def7b8d2a7f7025ec36b0075716ec"
Friday, February 8, 2013
sunshine on the north coast
- this "dr" says 50 degree altitude angle
- this link suggests that you can make vitamin D in atlanta (34 degrees north latitude) during the dead of winter
- this page (sketchy sounding url but with legit sounding citations) says 34 degrees north (ie, atlanta-ish again)
- here's one of the citations saying 34 degrees
Thursday, January 31, 2013
webstorm at 2 weeks
- supports JsDoc @augments tag - netbeans doesn't
- this is primarily useful for javascript that simulates inheritance
- it may also support @lends, but i didn't need the feature and couldn't get it to work in the few minutes i played with it
- "Go To Declaration" almost always works (if you've given the code enough JsDoc comments so that it is unambiguous - can't ask for more than that), appears to be model based
- "Find Usages" isn't great or terrible - seems to be primarily based on string matching, eg methods with the same name in different classes are jumbled all together - http://youtrack.jetbrains.com/issue/WEB-6360
- no way to limit the search to subclasses
- jetbrains claims that 6360 is fixed in the next beta !!! that only took 11 days ... impressive
- fails to detect file changes on disk that happen in symlinked directories - http://youtrack.jetbrains.com/issue/WEB-6438. this is a major failing, likely to result in lost work
- WORKAROUND: using the settings dialog, add multiple content roots. i've just converted to this arrangement - will have to wait to see if this solves the "file changed on disk" errors
- macros are so slow as to be useless - my favorite netbeans macro is "move up/down 10 lines and recenter the screen" which provides emacs-style scrolling. in netbeans this macro can scroll 400 lines per second. in webstorm, it's maybe 10 per second, can't key-repeat, and if you land on a line with a hint it activates the hint instead of the macro. ie, it's worthless
- changing files in webstorm is somewhat faster and "smoother" than in netbeans
"go to super method" doesn't work- it does, but the cursor has to be inside the definition, not on the prototype method name
- many features just don't work - i've googled and tried everything i found but i haven't submitted bug reports. if anyone knows a solution i'm all ears
- method hierarchy - either grayed out or does nothing
- call hierarchy - either grayed out or does nothing
- super method - does nothing (clicking the arrows in the margin works)
- the "Structure Tool" is somewhat broken - there's no easy way so select the file to show the structure of. WORKAROUND - have the file that you want active in the editor, "Navigate.Select In" and chose "Structure" (i've got it bound to Alt-4, 4)
- the interface for editing settings is much more responsive than in netbeans (possibly limited to linux ???). this made getting started with webstorm less painful than expected (had many shortcuts to set) but long term doesn't help much
- visual glitches
- when iterating thru "find usages", keyboard focus has a tendency to get lost - closing, reopening, and closing the "find tool" seems to bring the focus back
UPDATE: i'm pleased with the quick response (ie the workaround) on the symlink issue. will keep an open mind for the next 2 weeks (title changed as well)
UPDATE: jetbrains claims that 6360 is fixed in the next beta. it's really a feature enhancement - i was impressed they didn't outright reject it, doubly impressed that they actually worked on it
tl;dr - overall, webstorm is a good editor. webstorm's big wins so far are better support for javascript that simulates inheritance and excellent responses to bug reports
Thursday, January 24, 2013
"git stash save --patch" considered harmful
nqzero> git stash save -p
nqzero> git stash pop
error: Your local changes to the following files would be overwritten by merge: nutrweb/web/js/diary.js
Please, commit your changes or stash them before you can merge.
Aborting
nqzero> git add -u
nqzero> git stash pop # hard to recover if there are conflicts
if there aren't any conflicts this is the bee's knees. but if there are conflicts, there's no obvious way to undo the merge (ie un-pop the stash) - the index has been corrupted. any suggestions ? without this, git stash save --patch considered harmful, ie it's very easy to lose changes
WORKAROUND
git stash create a backup before popping the stash. maybe git should do this for any merge with a dirty tree
nqzero> tmp=$(git stash create)
nqzero> git stash pop
Auto-merging nutrweb/web/js/diary.js
CONFLICT (content): Merge conflict in nutrweb/web/js/diary.js
nqzero> git reset --hard
nqzero> git checkout $tmp -- .
Wednesday, January 16, 2013
jetbrains webstorm first thoughts
but in the meantime i've decided to try jetbrains webstorm, $50 for an individual license or a free 30 day trial. the code understanding seems better, especially the jsdoc support. still getting it configured, especially the keymap. documenting issues here
multiple shortcuts - the actions only appear to support a single shortcut. for some actions, i want more than one ... eg, for end of line i use ctrl-E (i'm an emacs guy), but i also want the "End" key to workSOLVED, in the settings.keymap page, just add another shortcut (i was trying to use the "add 2nd stroke" which creates a compound keystroke instead, emacs-style)- jetbrains sells themselves as shortcut friendly. and in general, the support seems pretty good. but the ultimate irony of webstorm is that the keymap settings are totally dependent on the mouse. you can't set shortcuts, delete shortcuts, search actions or search shortcuts using just the keyboard ... it's a clickfest. netbeans is much better in this regard (though at the price of the settings interface being slower and less responsive)
- the "Structure tool" should be super useful. in fact, this is pretty much my reason for trying webstorm. but i can't get it to change files ... ie, it always shows me the structure for classes defined in one file, but i can't change that file. the navigation bar reverts to the that file whenever i switch to the tool. bizarre
- WORKAROUND: Navigate.Select In.File Structure ... for me this is the compound keystroke [Alt-F1, 4] and i don't see any way to get there directly, ie with a single keystroke
- absolutely amazing feature find ... Column Selection Mode. allows deleting a rectangular region - been wanting this for forever !!! i've got to play around and see if you can do anything meaningful other than deletions
- and now that i know what it's called, it looks like netbeans supports it too (Toggle Rectangular Selection, or the rectangular selection toolbar button)
- emacs too ... string-insert-rectangle, delete-rectangle
- as best as i can tell, there is no way to tell if files have been saved or have outstanding changes ... yikes !!!
- tried to create a macro for emacs-style scrolling (ie, jump a number of lines and recenter the cursor - in my case i want 10 lines). the macro fails completely ... it's slow to replay and if there's a code hint on the line it activates the hint. total lossage !!! netbeans is much better in this regard
- type inference is pretty weak. if you jsdoc everything, webstorm is pretty good about keeping track of the types, but if you assign a known type to a local variable, it can't infer that the local is the same type. pretty weak. hoping that netbeans improves and can handle this logic
- lossage - [Navigate.Super Method] doesn't work. clicking on the override symbol works
Saturday, August 18, 2012
more voip notes
thurs slashdot had an article on Groove IP (a softphone that bridges to google talk)
so today i spent a bunch of time investigating voip again. good news - things have improved. bad news - not that much. notes are mostly just for my own memory
anveo
- this is my sip provider for outgoing calls
- there's a new option (unless i missed it before) to use localized dialing. i choose this option and set it to USA with 0 for the international dialing prefix. now i can dial from my contacts without having to prepend 0111
- i'm using a pay per minute account, and believe it only supports pcmu and gsm audio codecs
- still not really working - i can make calls and the callee can hear me, but i can't hear them
- hostname - sip.anveo.com:5010
- proxy - sip.anveo.com:5010
- audio: pcmu, gsm
- would register with anveo, but couldn't make calls
- deleted the old account (inside csipsimple)
- created a new account using the basic wizard
- copied and pasted the username and password
- server - sip.anveo.com:5010
- works, and audio quality seems better than i remember it (haven't tested much)
- installed this app
- couldn't get google voice integration working (didn't want it to use my primary google apps account and couldn't get it to recognize my gmail account)
- set it up to work with anveo
- server or proxy - sip.anveo.com
- port - 5010
- works, and audio quality seems ok (haven't tested much)
- mentioned in the slashdot article
- uses jingle to forward the call to google voice (instead of to anveo)
- i used my gmail account (instead of my primary google apps account) because i wasn't comfortable giving them access to my primary account
- i enabled 2-step authentication so that i didn't have to give them my password (not sure how much this buys me)
- it works, and call quality seemed similar to what the gmail phone widget achieves
- this is a big deal
- the only downside is that it can't be registered at the same time as the gmail widget (so i have to choose which one to have active prior to receiving a call)
- haven't tested call quality much, but if it ends up being decent, i'll buy the "Pro" version for $5
- this still seems to work
- call quality has always been marginal
Monday, July 23, 2012
the damp knight rises
- not enough civilians on the streets of gotham - place was deserted
- bruce's despair over rachel's death and hunt's betrayle wasn't convincing
- talia was an f'ng mess - in love with bruce and bane and rambling about fulfilling Ra's destiny
- talia and bane preach revolution and class warfare - victims in the pit of the entitled. they run the tribunal, which actually does off some of the corrupt rulers of gotham. and then, "oh by the way, we're gonna blow the city up". which they could have done on day one. f'ng nonsense
- bane and talia put batman in the pit *knowing* that he's gonna rise up and escape. they want him to, need him to, aren't at all surprised when he does ... so what the fuck for ?
- bruce can't tell that talia is *talia* ??? even after he's heard the stories in the pit ... he, the protector of orphans never asks "what happened to the child's protector". ftloc
- nobody has a plan for anything in the movie, there's no game of chess, no strategy
- pre-revolution, gotham is corrupt with the rulers dividing the spoils and everyone save kyle seems oblivious to it
- the police force has been pussified
- why the fuck don't bane and talia kill kyle. or fall in love with her. or at f'ng least realize that she exists
- one schoolbus of orphans is all blake, our hero-in-waiting, can muster to the bridge
- crane is awesome at the tribunal ... "death by exile !!!"
Wednesday, May 16, 2012
"upgraded" to ubuntu precise pangolin
so for me, all i really need the UI to do is show me what's happening with the computer and easily control it. i want to see cpu frequencies, load and temp; pulse audio volume and routing (speakers vs usb headset); switch between windows and workspaces; open a terminal with a keystroke and maximize windows (avoid the mouse as much as possible)
this isn't a review or even a rant. just need to keep track of some of the things that i used with natty that i haven't found good substitutes for yet. the big change with (oneiric and) precise is unity. i'm still not sure if it's a window manager or what exactly. but gnome-panel no longer works which was everything i needed in a UI. they've replaced it with some hybrid menubar / indicator area. which saves a bit of vertical - would be cool if i wasn't running my 1900x1200 in profile, ie rotated :)
ported from panel:
- indicator-multiload -- shows graphs of cpu, memory, net and disk usage in the notification area
apt-get install, run it, add it to the "startup applications"
- indicator-cpufreq -- displays and allows control of cpu scaling and governor
actually better than the gnome panel applet (sets freq for all cores, not just one)
doesn't include the cpufreq-selector, which allowed (easy) command line control of the cpus
missing:
- pulse audio mixer applet (allows easy routing of pa sources and sinks)
pavucontrol seems like the only "easy" way to control audio routing, but it's not even close to pama
- indicator-sysmonitor (available for 11.10 but not 12.04)
https://launchpad.net/indicator-sysmonitor/
some hack to make it work in 12.04 (not sure what that script is doing)
subpixel ordering:
gsettings list-keys org.gnome.settings-daemon.plugins.xsettings
gsettings range org.gnome.settings-daemon.plugins.xsettings rgba-order
gsettings set org.gnome.settings-daemon.plugins.xsettings rgba-order rgba
workspace switcher applet
my folks like to be able to switch workspaces using the mouse. in gnome2 you could do this in one click with the workspaces applet. unity requires 4 actions, ie bring up the launcher, click the workspaces icon, click on the workspace that you want to switch to, and (if that workspace has multiple windows open) click on the window that you want. ridiculous. and the zoom effect makes me nauseous too boot
can no longer control the arrangement of workspaces. i used to use 3 in a single row. not possible anymore. to control the number of workspaces use:
gconftool-2 -s /apps/metacity/general/num_workspaces --type int 4
which will give you 4, in a 2x2 grid. i think it always uses 2 rows
http://askubuntu.com/questions/66701/how-configure-workspaces-on-unity-2d
one of my machines my parents use and they like it to automatically log them in. this seems to be broken with lightdm - if i enabled automatic login then i was unable to shutdown or restart with any of the graphical controls ("shutdown -h now" still worked). to work around this, i switched to gdm and used the "timedLogin" option. note: gdm used to have an "automaticLogin" and that appears to be broken and cause gdm to terminate silently (only took me 6 hours to track that down)
machine with an asus m2a-vm-hdmi mainboard had problems with mouse jerkiness. seems to be that the driver is constantly probing for a monitor, gets back garbage cause there's nothing there and spams the syslog, which somehow triggers all sorts of issues. it's a radeon x1200 (or x1250, not sure) integrated video card and i'm using the radeon open source driver. adding "radeon.modeset=0" to the kernel command line options seems to have corrected that problem
one thing that is a real pain with unity is that it's not obvious what anything is. with gnome, you could for the most part right click on anything and get an about dialog or see the path of the program the icon represented (ie ran). for the most part, the unity UI is a black box. it does stuff, but you can't easily see the mappings. in the panel you could click on an indicator and move it, remove it, add a new indicator. not so in unity (that i've found so far)
in spite of all that, i'm pretty impressed with canonicals execution with unity. it's a major change, and for the most part, things "just worked". my laptop has seen a significant decrease in power usage. the HUD notifications are improved. dash is bizarre but looks cool. pulseaudio still works. i think they're on the wrong track in terms of trying to simplify things at the cost of configurability. instead they should be working towards making existing things more consistent, and make it straight forward to discover what is going on. but given the path they chose, they've executed reasonably well
interesting ... the netbeans editor seems to be *much* faster after the upgrade. have only used it for a few minutes, but it seems dramatic. more testing / using tomorrow
Wednesday, April 25, 2012
lenovo x60 battery REPAIRED
http://download.lenovo.com/lenovo/content/batt/082009/LandingPage.html
so i'm working under the assumption that it's a software/controller problem. some other's seem to be on the same page (http://www.levien.com/tp600-battery.html). so the deal is that if you can trick a lenovo battery into fully discharging, it will reset the controller and take a full (well, as much as the cells will accept) charge and you're back in business
but no pinout for the x60 battery, so i can't use the exact method that javier valero suggests. but i found a *simpler* workaround. while running on battery i put the machine into suspend and left it there, which drains the battery slowly. while suspended, the crescent moon led is solid green. after about 30 hours, the battery was really dead, the machine shut off and the crescent moon led went out
plugged in the ac adapter, started the machine. after a few minutes it told me the battery was 100% (even though i now know it's almost totally discharged). removed the ac adapter and waited a few minutes until the "critically low battery" warning came up and plugged it back in. the battery charged to full (24000mwh - the battery is *somewhat* old after all :) and has behaved normally since
note: during the long suspend, the machine woke up once (presumably because the battery told it that it didn't have enough juice to keep it in suspend for much longer). i plugged it in for a second, clicked "ok" (ie suspend again) and then removed the ac as soon as it went back to suspend. not sure if the ac was needed or not
- lenovo x60, stock other than 4G ram that i installed
- ubuntu 11.10 as the primary OS, windows xp still installed and occasionally used
- battery: FRU P/N 42T4631, ASM P/N 92P1170. fewer than 50 charge cycles (the x60 is usually plugged in). this battery was supplied by lenovo under warranty 3 years ago, but my original battery had a similar failure mode
|
tl;dr -- my lenovo x60 laptop battery failed prematurely (running ubuntu). i repaired it by leaving the machine in sleep till it shut down (crescent moon led went out), charging till "full" (only took a few minutes), discharging till "critical" (again, just a couple of minutes), and then everything worked normal, battery would hold 24000mwh
Saturday, April 21, 2012
sflphone 1.0.2 on natty
Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported