How to install java jdk 7 on Snow Leopard

The problem is that Oracle ships the Mac version of the JDK 7 installer with a builtin restriction: it'll only install on Mac OS X 10.7.* and above. It's fairly easy to work around this. You can do it either with Pacifist (a 3rd party shareware app) or the PackageMaker app which is installed with (some versions of) Xcode Tools into /Developer/Applications/Utilities/

Building strace from AOSP sources

Apparently some version of strace is part of AOSP. So checking out the necessary subtrees from the AOSP repository should let you compile your own binary. Of course this strace will always be at least a few versions behind the original strace project, so you might give a try to cross-compiling a statically linked version of the latest strace.

Cool commandline completion in Ubuntu 10.04 with the default bash shell

I'm setting up my company's new servers (installing Ubuntu 12.04, the current LTS release) and since a lot of configuration/features have to be "mirrored" from our old servers, I've set up SSH public key authentication so I can simply copy stuff with scp (and without entering the password each time) from the old server(s) to the new one(s). And I just got amazed by this: entered the start of the command specifying the server like this:
then I hit (accidentally) tab ... and voala! The builtin (out-of-the-box) command completion listed all the contents of the /mnt directory on the other server! Brilliant. That's what I call user (or admin Smile ) experience.

How to disable services in Ubuntu (using Upstart)

Ubuntu has been transitioning to Upstart for a long time now. In the early days one could disable a service only by renaming the job config file in /etc/init (to something that does not end in .conf) or modify the file so it won't start the job automatically.

How to install syslog-ng on Ubuntu solving the conflict with ubuntu-minimal

One of the problems with Ubuntu is its stubbornness. This bug is 7 years old now. It's pretty obvious that it's a bug and no Canonical employee ever disputed this in the bug's comments. The only progress they made so far was to replace the dependency of sysklogd with rsyslog (which was only to make Ubuntu's dependency system work since sysklogd was dropped/replaced with rsyslog over the years). It's a shame that Ubuntu doesn't provide more attention to the details. Sad

How to view the changelog of APT packages

Manually for each package:
aptitude changelog package-name

Automatically for each upgrade (and of course also manually):
sudo apt-get install apt-listchanges
sudo dpkg-reconfigure apt-listchanges

What to do if chmod/chown/rm commands result in "Operation not permitted" error

"Mac has many enhancements to Unix in the area of files. Ignoring the whole resource fork thing which is not used much anymore, there are:
  • the standard Unix permissions ugo rwx and so on. Normal Unix tools apply.
  • ACLs, viewable with ls -le and changeable with chmod [ -a | +a | =a ].
  • file flags viewable with ls -lO and changeable with chflags.
  • extended attributes, viewable with ls -l@ (attribute keys only) and changeable with xattr. (Note that there is no man page for xattr, but it's a simple program described with xattr -h.)

Adjust the startup chime volume of your Mac

To adjust the volume on your Mac's internal speakers:
  • Unplug speakers or headphones from the headphone jack.
  • Go to System Prefs > Sound, then click on the Output tab.
  • You will then see Internal Speakers (Type built-in) highlighted in the window.
  • Adjust the output volume (which also controls the chime volume) in the slider at the bottom of the window. Remember if you mute it there will be no internal speaker sound.
To set the volume for your external speakers:
  • Plug in speakers or headphones to the headphone jack.
  • Go to System Prefs > Sound >, then click on the Output tab.
  • You will then see Headphones (Type built-in) highlighted in the window.
  • Adjust the output volume (which controls the chime volume in the external speakers) with the slider at the bottom of the window. Remember if you mute it there will be no external speaker sound.

How to limit the number of records put into an INSERT statement by mysqldump

The mysqldump manpage says:

The initial size of the buffer for client/server communication. When creating multiple-row INSERT statements (as with the --extended-insert or --opt option), mysqldump creates rows up to net_buffer_length length. If you increase this variable, you should also ensure that the net_buffer_length variable in the MySQL server is at least this large.

Changing Android system settings (eg. airplane mode radios) via commandline (on rooted phones)

There's this old question at about how to change system settings stored via android.provider.Settings.System using a shell command. The answer is: SQLite.

Syndicate content Syndicate content