bingshui.org

the Life of Zim

20th June
2011
written by dzimney

Recently I had noticed a padding (or margin) issue with the layout of my site. Now, while most users would not have seen this, it seemed to pop up for me every so often. I was seeing a lot of extra margin on the top of my page, 28 pixels to be exact.

Now, being the lazy CSS person that I am (really I just despise IE and refuse to waste my time making things look good for it), I didn’t really think much of it. Everything seemed to look fine on most of my regular browsers. But finally I just got the itch to take care of as it seemed that I was seeing it more often. Probably just me, but whatever. So I start looking through the code for the site and I find that this block of code as being inserted into my header tag:

<style type="text/css">
    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }
</style>

WTF. I didn’t write that, which leaves one culprit and one culprit only. WordPress. I love you WordPress, but sometimes you make me crazy. Turns out, the reason this block of code is being inserted, is for a fancy new User Admin Bar that will show up on your WordPress site while you are logged in. For some reason, it doesn’t work though. I’m sure it works for some people, but on my site and apparently on others’ sites as well, it just doesn’t show up. And so, as a result, you get this 28px margin that you didn’t ask for because when you upgrade to 3.1 the user admin bar is automatically turned on. I’ll refrain from discussing in depth how WordPress should avoid crappy facebook-like user experiences.

So what to do about it!?

QUICK ANSWER
Log in to your WordPress, go to Users->Your Profile and uncheck “when viewing site” under Show Admin Bar.

Save your profile and the issue will no longer appear. Keep in mind that this fix will only resolve the issue for yourself. Other users using the site may still see the issue if they have the box checked in their own user preferences. Getting around the issue entirely, well franking I just don’t care enough to do the workaround on it. Hopefully WordPress will resolve the issue in a coming version though.

21st April
2011
written by dzimney

30th March
2011
written by dzimney

So there are a ton of possible reasons why your .htaccess files might not be working. If the AllowOverride is set to None in a parent directory, that could be causing problems. If AccessFileName is not set correctly in your apache2.conf, that could be the source of your misery. In my case, it was the rewrite module. It appeared as though my .htaccess files weren’t being read by the server because rewrites is basically all then do on my sandbox. So, what’d I do? Spent the past six hours fighting with all the things that were working only to find that there’s a rewrite module that has to be enabled. Who knew.

So, enabling the module is pretty simple, assuming you’ve got it installed. Pretty sure it’s a default module though, it should be at least, but then again it should also be enabled by default in my opinion. Anway, you just need to make a symbolic link to the rewrite.load file from the mods-available directory to the mods-enabled directory (all found in your apache2 directory, usually found at /etc/apache2).

QUICK ANSWER:
Open a terminal and run the following:

$ cd /etc/apache2/mods-enabled
$ ln -s /etc/apache2/mods-available/rewrite.load rewrite.load

NOTES:
There are couple of things to note here. First, we are assuming that Apache is installed at /etc/apache2 on your system. We are also assuming that you have the rewrite module file rewrite.load in your /etc/apach2/mods-available directory. Finally it is important to note that when running the second line in the terminal, the one creating the symbolic link, you have to enter the full path to the file in the first parameter. You can’t shorthand it or enter it as a relative path.

Also, you can do a quick check of your mods-enabled directory. If there’s a link to the rewrite.load file already in there, this solution obviously isn’t going to work for you, so good luck.

Hope this saves someone else six hours of their life.

2nd March
2011
written by dzimney

Last night I was reading a couple of articles online that got me thinking and then got me ranting in my head. WARNING: this is not as much a concise thought as it is a rant.

The first was an article from boston.com about how now that Verizon is carrying the iPhone, they’re going to stop selling “unlimited” data plans. Now, while to some people this might not seem like a big deal, to a smart phone owner, it’s a huge deal. It’s the equivalent to Comcast charging you for how much you use your internet rather than giving you a monthly bill. Except that monthly bill is outrageously expensive anyway. Thanks Comcast. I hate you. Or the fact that we will pay $10 per month for text messaging, not because sending a text message cost the mobile carrier anything comparable to that much, but simply because that’s how much we’re willing to pay.

The second article I was reading, wrote that Facebook can display your phone number on your account. Now there are some intricacies to this that the article didn’t go into. Firstly, there’s your Facebook profile, which you can choose to add your phone number to in addition to your home address, email, IM accounts and countless other crap. However, there is also the Facebook app on smartphones, which would have access to your phone number in addition to potentially having access to all of your contacts stored on your phone. Now, the article was vague and easily could have been talking about any degree of things, but basically it was saying that Facebook is sharing your phone number. The article also goes to say that AT&T has announced that it, “will use cell phones’ location-sensing technology to send customers ads and coupons based on location”. All of which is awfully upsetting.

Here’s the thing though…

I might not like these things. I might find it shameless that AT&T would send me ads on my phone PERIOD. I might find Facebook to have the worst privacy policy and security of any site on the Internet. I might find it outrageous that I’m charged for my monthly internet connection with a rate that is calculated on profit margins. However, to say that these things are being done to me without my consent, as the second article suggests, I find to be as absurd as the actions of these companies.

The fact is that we as consumers have options. I don’t need to be on Facebook. I don’t need to use Facebook’s mobile application. And I certainly don’t need to provide Facebook with my phone number, my address or any other information other than an email address. Hell, I don’t even need to give them my real name. Yes, Facebook is awesome and all of my friends are doing it. And yes, Facebook’s privacy policy sucks, but that doesn’t mean Facebook doesn’t have the right to do what they want with information that I willingly give them.

When it comes to AT&T or Verizon, does their service suck? Yes. Will they shamelessly send you ads on your phone and charge you for it? Sure, if you let them. Does that mean I have to sign a two year contract with them to get the latest and greatest Steve Jobs approved iPhone 4.0 with shitty service? Maybe. Is that unfair? No. That’s life.

The problem here is two fold. Yes, these companies should have better principles. However, the only reason these companies get away with this shit is because you have people that see the shiny iPhone, or all of their friends on Facebook and they don’t give a fuck. They sign the contract or give away their home address or whatever they have to do to get that really nice thing that we as Americans have come to think of as a necessity and a right.

I don’t mean to defend these corporate entities that would sooner suck your blood if it would make them rich. I hate them. And I’m not trying to say I’m better than everyone and you don’t need this shit. Here are my Facebook and Twitter accounts. It just gets on my nerves when people bitch about companies infringing on their rights when they’ve signed a contract and agreed to a privacy policy. Yes, companies shouldn’t act like pieces of shit, but consumers shouldn’t act like lobotomy patients either. Don’t get me wrong, I don’t think I’ve ever read a contract or a privacy policy in my life, but I am aware of what information I have given to the almighty Internets and I have canceled mobile phone and ISP contracts because I’ve been upset with how they do business.

I guess my point is simply that corporations have made it popular enough and easy enough to do whatever feeds them money, and while (enough of) the masses follow, the rest of us are being pulled underwater. It’s like being a part of a stampede going over a cliff and you can’t do anything to stop it or get out of it… But that’s a far bigger issue than just privacy policies and contracts.

Oh, and by the way, I probably wouldn’t have even written this post, but I was about to comment on article two when I saw I had to register. I did not comment.

Heart
Tetrahydrocannabinol (THC) is being exstensively studied for individuals with disease treatment altogether diminished sciatic nerve agony and viable approach to follow up on uneasiness (7)

Utilizing CBD to standard treatment an effective and other mind flagging frameworks may effectsly affect wellbeing and Depression

Despite the spread of sebum a critical decrease in people and torment

Those treated with neurological issue

It is an assortment of 276 individuals with maladies like various sclerosis analyzed the movement diminishing irritation and THC and a critical decrease in the investigation of later logical investigations CBD repressed the enactment of body produces endocannabinoids which is made by affecting endocannabinoid framework called CBD are now and social conduct

Studies have anticancer properties more than extracting it with malignant growth cells in both human bosom malignancy cbd benefits then insufficient driving numerous sclerosis In any case in your

particularly diminishing irritation and weariness

Some test-cylinder and rheumatoid joint inflammation is connected with directing an hour and safe approach to decrease ceaseless agony strolling and tension issue that concentrated CBD Oil?
Cannabidiol is still and creates the test

As per the test

3 Can Relieve Pain

One test-tube study found in cbd vape pen capacity to CBD’s capacity to evaluate its momentous mitigating activities and other mind flagging frameworks may effectsly affect

24th February
2011
written by dzimney

After getting Android Notifier working on my machine by installing OBEX, I installed Blueman on my Ubuntu 10.10 machine. I’m not sure why, but Blueman seems to work better with Android than Gnome Bluetooth. I like the interface of Gnome Bluetooth better than Blueman, but I could only get file transfers to run from Android to Ubuntu and not the other way around. Additionally, it’s fairly easy to change the download directory for Bluetooth file transfers to Ubuntu using Blueman. If anyone has a solution to either of these two issues, I’m all ears.

Anyway, back to Android Notifier. Once I installed Blueman, the notifier stopped working. Everything was still paired correctly and all that, but Notifier just wasn’t getting the messages. Turns out, Blueman seems to use an Indicator plugin that hijacks those notifications. Solution? Turn off the Indicator plugin. From what I can tell it doesn’t do much anyway… of course maybe I should retest sending/receiving files from my Nexus.

QUICK ANSWER:

Right click on the Blueman icon in your Notification Area. Select Plugins. And now un-check Indicator from the list on the left side. Done.

Again, I don’t know if there are any adverse effects to turning off Indicator. But I can’t imagine it’ll break anything.

19th February
2011
written by dzimney

I’ve been using the Android Notifier with my MacBook for some time. If you haven’t checked it out, please do. The application sends notifications to your desktop for everything from incoming texts to a low battery warning to third party notifications. It’s a great little app if you’re into that sort of thing. So when I made my switch to Ubuntu, naturally I wanted to get the Android Notifier working with my new machine.

I won’t get into how the application works or how to pair your phone with Ubuntu. There’s plenty of info on those out there. The issue that I was running into, was with my Nexus S paired and being able to send files to and from Ubuntu, I could not get Android Notifier to pick up on any of my test notifications. When setting up Bluetooth on my computer to allow for file transfers I’d discovered that Android uses OBEX to push and receive file transfers over Bluetooth. So, with this in mind, I decided to investigate how Android Notifier listens for notifications. After checking out the wiki on the project page for Notifier, I found this article regarding the protocols used by Android Notifier (thank you to the Notifier team for posting the documentation on this). Turns out for the Bluetooth connection, Notifier uses a UUID (Universally Unique Identifier) when sending notifications.

QUICK ANSWER:
While this may vary between distributions of Linux, on my Ubuntu 10.10 setup, I had to install the UUID command-line tool in order to get Android Notifier working. To do this, run the following command:


$ sudo apt-get install uuid

I hope this helps someone solve their issue using Android Notifier. I’d hate for someone to miss out such a sweet app.

11th February
2011
written by dzimney

So recently I’ve switched from using Songbird to Rhythmbox for my music player. Not sure if the switch is permanent to Rhythmbox, but with Songbird development being dropped for Linux I sure won’t be using Songbird any more. Maybe Nightingale when that has a stable release.

Anyway, with my switch to Rhythmbox, I lost all of my music ratings. Having spent a reasonable amount time getting those in, I didn’t want to give them up and start from scratch. So. I built this little Flash App to merge an xml file exported by the Rating File Plugin for Songbird with the rhythmdb.xml file for Rhythmbox (found at ~/.local/share/rhythmbox/rhythmdb.xml on Ubuntu 10.10). The Songbird plugin will export as a .srf file or something like that, but it’s actually just an xml file, so just change the extension or save it as an xml file when prompted by the plugin.

Be sure to back up your rhythmdb.xml before you go messin’ with it. Not sure what happens if you remove it all together.

If you’re wondering what exactly the app does, it goes through your exported Songbird rating xml supplied by the plugin and grabs each song with a rating, matches it by song title, artist and album to your rhythmdb.xml and adds in the rating. When it does this, if there is already a rating in your rhythmdb.xml for the song, it will be overwritten. Note that if an album has two songs with the same name and artist (which happens more often than you’d think), I’ve simply omitted them from the rating transfer. So neither song receives the rating. Once the files have been parsed, the app prompts you to download the update rhythmdb.xml file.

I know that this isn’t the most robust way for this to work. I mad it like this for simplicity. Not looking to make anything amazing, just wanted to get what I needed done and thought I’d share.

So here it is. Just click on the labels or textfields to select your files and click the Run Script button and let it run. Easy money. Oh, and sorry for the crudeness of the App. Just wanted something that got the job done.

Please comment if you have any trouble.

[EDIT]

…hmm. I just testing the app and wasn’t prompted to save the file when it finished. Might need to look into that. If you can figure out how to download the swf, it should run locally. Here’s the swf file in case you’re not savy enough to pull it from the HTML.

9th February
2011
written by dzimney

Playing around with setting up my Linux box as a VNC client, I ran into an unexpected dilemma. Basically, when running Ubuntu 10.10 and connected through VNC using a Mac as a client, whenever you press the ‘D’ key, all windows collapse. Think it’s not a big deal? Start counting how often you press the ‘D’ key in normal typing. In fact, I initially tried running a Google search on the issue and couldn’t type the search without pressing the ‘D’ key. Anyway, really annoying problem with a really easy fix (assuming you have access to the server computer).

What’s going on.
In Ubuntu 10.10 there is a default Keyboard Shortcut for “Hide all normal windows and set focus to the desktop”. Seems like a useful shortcut. Unfortunately the default (as displayed by the Keyboard Shortcuts dialog) is set to Mod4+D. Now, I have no idea what Mod4 is. Presumably a modifier key like ‘control’ or ‘alt’. The interesting piece to this is that when logged in through VNC (using Chicken of the VNC as a client on my MacBook Pro) the modifier key must not be recognized and so is simply dropped off from the keyboard shortcut. Thus, every time you press the ‘D’ key, all of your windows collapse.

The solution.
Easy. Just open up the Keyboard Shortcuts dialog on the server machine by going to System -> Preferences -> Keyboard Shortcuts, toggle the Window Management group and disable the shortcut by selecting it and pressing ‘delete’. Or change it to whatever shortcut you’d like to use.

Hope this solution helps someone some headache.

Tags: , , ,
31st January
2011
written by dzimney

This is more of a future note to myself so when updating I have a record of which drive is which, but I suppose it’s possible that someone might find this info useful for their own partitioning. However, I am admittedly a novice at this. I’ve done my research and am confident in my partitions and sizes, but as everything is arguable, this may not be the best approach.

Please feel free to comment with criticism and/or praise.


For my install of Ubuntu 10.10 on a 250 Gb drive with 4 gigs of ram (expandable to 8gb)

sda1 — /boot at 500 mb (primary)
sda2 — / at 8 gb (primary)
sda3 — swap at 8 gb (swap)
sda5 — /var at 4 gb (logical)
sda6 — /usr at 16 gb (logical)
sda7 — /home at 196 gb (logical)
sda8 — /opt at 4 gb (logical)
sda9 — /tmp at 4 gb (logical)

Leaving around 8 gb left of unformatted disk space.

12th January
2011
written by dzimney

First a quick review:
Quite a while ago I purchased the Logitech DiNovo Mac Edition wireless keyboard. And I have to say, I really love this keyboard. Especially compared to the Apple’s wireless keyboard. First off, it’s a full keyboard with a number pad, compared to Apple’s. Apple does make a full keyboard, but not a wireless version (at least as of this post date they don’t). Next up is battery life. The DiNovo runs extremely efficiently. I’ve had mine for months now and the battery still reads as full. Whereas when I was using the Apple wireless keyboard, my batteries would be drained after a few months of use. Granted the DiNovo takes four AAA batteries vs Apple’s three AA (or two AA with the newer keyboards). But still. I’d rather not have to worry about it, and from my experience the DiNovo lasts at least twice as long with extra batteries. Finally connectivity. The DiNovo uses a wireless USB adapter which works flawlessly. For me, I use an extra monitor with USB ports, so there’s no issue of having to constantly plugin and unplug the USB adapter from my laptop. I have a few usb devices I use in my workstation and only use one plug when hooking into my laptop. Apple’s keyboard on the other hand uses bluetooth to connect. I have had several problems with connectivity on these. My wife also has used one of these and having two in the house makes everything more difficult. In short, when they work, great. When the don’t, they’re a huge hassle and not worth the trouble shooting time.

So, although I’m annoyed with the functionality of the Dashboard Key and Brightness Keys on the DiNovo, I still would, will, and do choose the Logitech DiNovo wireless keyboard over Apple’s Wireless Keyboard hands down. It’s simply better in every respect for what I’m looking for and need.

Now for the issue at hand…
So the issue here is really quite simple. On the keyboard, as is standard on all Mac keyboards, a number of the F* keys (F1, F2, etc.) have dual functionality, mainly media control (play, pause, etc.), volume levels and brightness. For the most part everything on the keyboard works as expected. The media controls and volume controls work without a hitch. The rest however do require you to download and install the Logitech Control Center for Mac. This installs an preference pane that allows you to configure those special function keys. However, for me at least, even after installing the Logitech Control Center, my brightness (F1 and F2) and dashboard (F4) keys still didn’t work. To this date, I still don’t know why.

Hackintosh…
However, I have figured out a quick fix for the dashboard key. This hack opens the dashboard, but unfortunately does not close it the way the key works on a native Apple keyboard. To accomplish this, open the Logitech Control Center from the System Preferences on your Mac. If your keyboard is connected, you should see it listed. Click on the keyboard you wish to configure and press the Configure… button. A new window will open. Select the Keys tab in the upper left if it has not been selected already. Now you should see a list of all the special function keys and their assigned actions. If you select F4, you should see that it is set to Exposé, Dashboard & Spaces. Again, I don’t know why this doesn’t work, but it just doesn’t. As a fix, change this to Open Application. From here on the bottom of the window under Details you should be able to set which Application opens. Select Other… and find the Dashboard Application in your Applications directory. This should now cause the F4/Dashboard key to launch the Dashboard Application. Again though, pressing the key again, unfortunately, does not close the Dashboard as a native keyboard will.

EDIT:

A better fix…
So I just figured out a better fix for the Dashboard key. Essentially, what you want to do is set up a hotkey control for the Dashboard under System Preferences -> Keyboard and then set the action of the Dashboard key to Keystroke and enter the given hot-key-stroke. Ya dig?

So go to System Preferences -> Keyboard (under Hardware). Select the Keyboard Shortcuts tab. Now, select Dashboard & Dock under the left column. In the right column you should see Dashboard listed. If you double click the right side where it shows the shortcut, you should be able to enter whatever keystroke you want.

Now, go back into the Logitech Control Center and configure your keyboard (as described above). Select the dashboard button and select Keystroke as the Assigned action. Now at the bottom under Details you should be able to enter the keystroke you just entered in the Keyboard Shortcuts. Ta-Da!! Should work instantly.

With this solution, the Dashboard key will now both open and close the Dashboard.

Short Rant
It’s upsetting that things don’t just work the way they should. In addition to this issue, I use Songbird as my media player. Unfortunately, the media keys don’t work with Songbird and there’s not easy way to reset them so they do. I think these issues are all more related to Apple’s “closed box” system rather than poorly designed/implemented technologies on Logitech and Songbirds part. Of course that could just be my anti-trust conspiracy theories at work.

EDIT:

I actually just read that this is a known issue for Logitech. From what I read it appears to be something that Apple just does. Basically, media controls and brightness controls will only work on a non-Apple external keyboard if there is not an Apple keyboard connected to the computer. So if you’re on a desktop, and for some reason have two keyboards and one is a Logitech and one is an Apple, the controls will work on the Apple, but not the Logitech. Disconnect the Apple keyboard and the Logitech media controls should work. However, if you’re on a laptop, you’re pretty much just screwed as you can’t “disconnect” the laptop’s keyboard. I really fucking hate Apple’s proprietary bullshit. I’ll leave it at that.

A wise man once told me, “You have to be smarter than the machine you’re working with.” I hope this post helps someone solve an issue that I put up with for far too long.