How to fix that mistake commit you just pushed to your git repository

I’ve already written a time or two how you can use git rebase to change your commit history as you work. Handy handy.. I think everyone should know how to do that.

Next up.. what if you pushed a commit and realize it’s not so great. First of all, everyone discourages this of course. The encouraged way is to just make another commit that fixes what you want different. We all want to break that rule every now and then though. Here’s how…
Continue reading

Posted in Programming | Tagged , , , | Comments Off on How to fix that mistake commit you just pushed to your git repository

Changing server ip addresses

OK, so I changed my virtual server ip address in response to my host being allocated a new block of IPs. Anyhow, things seem to have gone ok. I changed DNS timeouts to short, waited, updated everything etc etc… Of course, it seems that there are always some DNS servers here and there that don’t quite play by the rules. That and I don’t directly control my secondary name server. Hopefully nobody experiences too much down time.

Posted in System Administration | Tagged , | Comments Off on Changing server ip addresses

Git Rebasing Tips

So there you are, using git to store, track and share your code with a few others. Maybe many others. You make a change, someone else makes a change, one or the other of you pulls the others changes and BAM.. you get that merge commit. It really isn’t harmful of course, but it cleans up your repository a lot to get rid of them. So…

  1. When you pull, use –rebase.
    git pull --rebase
    

    There. It did it for you. All your commits go after the commits on the remote origin.

  2. You forgot to do that. No prob…
    git pull # oh man.. I forgot.. merge commit
    git rebase origin/master # There.  Pretty easy isn't it.
    

So of course, you might have the same issue if you were working on a branch. You check out master, make some commits, go back to your branch, make some more, etc. It works the same way.

# on your branch
git rebase master

There. You can pull in the master branch changes but put all your branch changes after so you don’t have to have the merge commit again.

So you wrote that branch, changed master, and then you merge your branch back to master and get a merge commit again. In this case there isn’t a ref to rebase off of so intuitively like remote/origin or master. No prob, just use gitk or git log or whatever to find out what the sha1 of the old master was before you made your merge.

git rebase 

There. No merge commit again.

Now, there are a bunch of more advanced things rebase can do. You can use it to edit commits that weren’t quite right. You can also change the order of commits, edit the commit message, drop commits completely, and other cool things. You can do it all interactively too…

git rebase -i  # fun for all!

I leave you to study that part on your own.

Posted in Software | Tagged , , , | Comments Off on Git Rebasing Tips

Fixed my RSS feeds

I hadn’t realized I was a victim of the wp blank line bug in my RSS feeds. I found an extra space at the bottom of my wp-config.php file. Fixed. Perhaps that’ll help the rss readers out there.

Posted in Miscellaneous | Tagged , , | Comments Off on Fixed my RSS feeds

Netflix: Your parental controls break everything

Normally I’m an email kind of guy and if a site takes so many precautions to not publish any possible way to contact them except via phone, I’d just bag it altogether and choose an alternative. I actually took the time to call Netflix though. Their streaming service is pretty much unusable for us. I’ve been tempted to just completely disable it and wait until some future date when they get it better but the kids want their cartoons you know..

Ah, that’s the reason the problem exists in the first place. Kids. The story goes something like this: You hook up your Netflix ready device and are all excited to stream Netflix content right to your living room so your kids can watch TV for $8 a month instead of whatever unreasonable fees your cable provider would charge for content you don’t want. You turn it on, log in and walah.. tons of content all on demand. So far so good.

Next you notice that right there along with your kids favorite cartoons they are advertising the latest horror flick complete with graphic images and sexually suggestive content. You think to yourself, ah, no problem. I’ll just go ahead and enable those parental controls. Great. At first you try PG/unrated, thinking that will do it but you realize that there are still a bazillion Pre PG-13 films from the 80s that show up in your content and aren’t exactly what you want your 7 and 5 year old browsing through.

Finally you choose rated G content as the last alternative. Great. Now the only thing your kids see is Barney, Thomas the Train, Care Bears and a bunch of other kids content. Problem solved. Sort of.

Problems Created:
* You can’t override your Netflix ready device with a password when you want to watch something besides a kids show.
* If you change the controls back, it takes 6 hours before the devices are updated.

So yeah. It’s either all good and safe for your kids, but unusable for you, or your kids don’t get access. Hm.

Anyway, back to the phone call… they said they are aware of the issues and are working on a solution. In the mean time… I’ve ranted enough now I guess.

Posted in Miscellaneous | Tagged , , | 5 Comments

Pulling libraries off Android phones

Well, have you ever wanted to pull a bunch of libraries off an Android phone? I bet you wish you could execute the command like this:

> adb pull /system/lib/*.so

Sorry. A no go. What about this then:

> for file in `adb ls /system/lib/`; do adb pull /system/lib/$file; done

Well, almost, but adb ls attaches the \n\r to the files. That wouldn’t be a problem if adb pull didn’t attach them to the names, so you have to get rid of the white space. This can work:

> for file in `adb ls /system/lib`; do adb pull `echo /system/lib/$file | tr -d '\n\r'`; done

Yea. Enjoy.

Posted in Programming | Tagged , , , | Comments Off on Pulling libraries off Android phones