All posts by kortsi

SQLAlchemy Declarative Class Reflector

3.00 avg. rating (63% score) - 5 votes

SQLAlchemy has a nice reflection facility which takes for example a database table name as argument and produces a Table object out of it for manipulation. However, those objects do not behave like the objects produced by declarative classes, which are easier to work with. Here’s a little class that helps to bridge that gap by reflecting proper declarative classes from database tables. It has only been tested with PostgreSQL, but it may work with other databases as well. Continue reading SQLAlchemy Declarative Class Reflector

Editing Tabular Data in Vim

3.33 avg. rating (68% score) - 6 votes

Helpful settings for editing tabular data:

Noexpandtab disables expanding of inputted tabs to spaces. Adjust the number of spaces to your liking. Tabstop sets the visual appearance of tab stops (here 16 spaces). Continue reading Editing Tabular Data in Vim

Developer Mode for the Samsung Galaxy S4

3.43 avg. rating (70% score) - 7 votes

From: Developer Mode for the Samsung Galaxy S4

Get to the phone’s settings by tapping ‘menu’ from the home screen and then tapping ‘settings’

  • tap on ‘more’
  • tap on ‘software information’
  • tap on ‘About Device’
  • find the build number, and tap it 7 times
  • on the 7th tap, a prompt should appear alerting you that Developer Options has been unlocked

You may also wish to:

And after that you must accept the USB connection by tapping OK in the prompt on the device after you connect it.

How to prefer IPv4 over IPv6 for some hosts

2.86 avg. rating (60% score) - 7 votes

If an IPv6 address is unreachable, but you can reach the IPv4 one, you can set the preference to IPv4 for that particular address by adding a line such as this in /etc/gai.conf:

That will set the preference for host 198.145.11.105 to IPv4.

See gai.conf(5) for details.