674 reputation
1414
bio website
location United States
age 43
visits member for 3 years, 7 months
seen Dec 3 at 3:17

Working amidst the ever merging & forever blurred realms of technocrat and troglodyte.


Nov
8
comment Logout takes too long
possible duplicate (but not answered) askubuntu.com/questions/145573/…
Sep
24
awarded  Autobiographer
Sep
19
comment How can I find corrupted characters in a text file?
if you have a text file, can you just use: iconv --from-code=UTF-8 (or --from-code=ASCII, etc)? The iconv utility will print "illegal input sequence at position {n}" on the line that has invalid data for the given input. You may also specific a target encoding; if the data can't be converted, you'll also receive a detailed error message.
Sep
19
comment How to display a random line from a text file?
GNU/Linux/Un*x has a lot of very well road-tested wheels I wouldn't want to re-invent, not unless it was a purely academic exercise. The "shell" was intended to be used to assemble lots of little existing parts that could be (re-)assembled in various ways via input/output & plenty o' options. Anything else is bad form, unless it's for sport (e.g, codegolf.stackexchange.com/tour), in which case, play on...!
Sep
19
comment How to display a random line from a text file?
A stylistic alternative (bash): LINES=$(wc -l < file.txt); R_LINE=$((RANDOM % LINES)); sed -n "${R_LINE}p" file.txt
Jun
11
comment How set CLASSPATH variable for a folder in Ubuntu
Why is everyone adding "{JAVA_HOME}/lib" to their classpath? It's not necessary, or even a good idea. For that matter, setting the env CLASSPATH is also a bad idea, unless it's in a shell script, just for that script, in which case, the command-line option "-cp" to java would still be preferable.
Jun
11
comment How set CLASSPATH variable for a folder in Ubuntu
@zhihong you should consider using an IDE like netbeans, letting it defer to the build tool in use, which actually configures your classpath. In Netbeans, set up a new project using maven or gradle (or ant -- but this gets too complicated when dealing with dependencies (see also: maven ant tasks, which I prefer over ivy)). Gradle is currently the 'hot' thing, fwiw; you should give it a try. Also, (1) you should always use package names; and (2) there's never a need to include classes in the jvm directory in the classpath; they are already in the "boot" classpath.
May
9
awarded  Yearling
Feb
17
comment How to configure chrome to open magnet url's with deluge?
Holy sh*t, mate, whoever told you to run this should be added to your "block" list. I stopped reading at cd /usr/bin; sudo sed ... xdg-* ... not every file xdg-* is actually a shell script; some are binary. You need to fix your system if you actually run something like this (you might be ok, since it may not have changed the files at all...) In any case, *_DESKTOP_SESSION_ID is unrelated afaik to the topic at hand, but even so, you just set/unset the env var; you don't sed all scripts in /usr/bin.
Feb
13
awarded  Caucus
May
9
awarded  Yearling
Feb
26
comment Where are the system-wide proxy server settings?
I just found the answer to my previous comment => see askubuntu.com/questions/150210/… => if you have "none" and "manual" predefined, simply run: gsettings set org.gnome.system.proxy mode 'manual' or gsettings set org.gnome.system.proxy mode 'none' , but you can also set specific host/port proxy settings there too (less of an issue for me though)
Feb
26
comment Where are the system-wide proxy server settings?
This is a real Ubuntu 12.x PITA for me. Twice a day I have to open up this "network" dialog, navigate via the mouse from "wired" to "proxy", and set my proxy settings to/from manual to no proxy (for my work laptop). It wouldn't be so bad if the network applet popped up with "network proxy" already with focus, but as it stands, I don't even think you can "tab" through to get to the proxy settings. (Using laptop mice-nipples are like friggin' surgery.) There has got to be a better way: I just want to open a proxy setting dialog, or simply set this via terminal+gconf or something...
Feb
4
comment How do I remove or hide old kernel versions to clean up the boot menu?
Rather, install "Ubuntu Tweak" as described in another answer (its own ppa), which has its own "computer janitor" (not to be confused with the "computer janitor" that temporarily was available in older ubuntu versions)
Dec
2
comment Should I install programs from a source tarball (`.tar.gz`), from the Ubuntu Software Centre, or from elsewhere?
If asked as four separate questions, the answer would/should be the same for all four: prefer installing/updating using a pkg manager from repo's (main or 3rd party). If that's not an option, then you can start getting into the general pro's & con's of this 'n that -- but at that point it probably boils down what app is being used & what you specifically want to do with it. (E.g., I install the standard provided "java" from the public repo, but as a developer I also install 5 different versions in /opt/java via tar.gz's).
Sep
29
comment Setting up JAVA_HOME and CLASSPATH correctly on 12.04
If an output log file was created, then the log4 config was found and this answer is correct. If no log file was created, the log4j config file was likely not found at all. Normally a log4j config should have a default appender including everything under "org.*" , "com.*", etc., to avoid errors like this. There's also a chance that this message was printed before logging was completely configured, and later log messages actually did make it to the log file. If this is your own app, then using slf4j instead of (or as a wrapper for) log4j will make your logging and your life much simpler.
Sep
29
comment Setting up JAVA_HOME and CLASSPATH correctly on 12.04
@sridhara a classpath usually lists actual jars. Directories are for "exploded" (unarchived) jars or other unarchived resources (such as log4j config.) (A directory of jars can also be specified: see askubuntu.com/questions/186693/… ) That being said, setting a global CLASSPATH is bad/wrong. Rather, there should be one classpath per individual application: thus use command-line options (e.g, java -cp dir1:dir2/foo.jar:dir3). (Note: depending on the tool, the cmd line option might be -classpath or just -cp).
Sep
29
comment Setting up JAVA_HOME and CLASSPATH correctly on 12.04
Neither JAVA_HOME nor CLASSPATH are "required" to run Java apps. By convention, shell scripts invoking Java apps may use JAVA_HOME to point to one JVM when there's more than one installed, or it's installed in a non-standard directory not in the PATH. If not programming (ie: using multiple JVM's + mvn/ant etc), don't set it; just use (g)alternatives to put Java in your default PATH. If you do set JAVA_HOME, the executable is always $JAVA_HOME/bin/java. The var CLASSPATH is used by the JVM, but don't set it (very error-prone). Instead use the cmd line options for javac/java/ant/mvn.
Sep
29
comment Setting Java CLASSPATH
+1 on not using env vars, but rather using the command-line options. For more context, see my answer here on the same subject: askubuntu.com/questions/186693/…
Sep
17
comment I'm having problems with Ubuntu
choosing (vs. simply not knowing) to misspell words like "coz" (vs. "because") or starting the subject with "HEllo" will get you down-voted before your question is even read, regardless of the quality of the question.