Get the SHA1 hash of the commit that you wish to revert to.
% git log
...
commit 9ce5e10ac4fe43e9b580344454dd27172b6c4456
Author: Simon Cornelius P. Umacob
Date: Tue Jan 20 16:30:42 2009 +0800
show/hide icmp6box
commit f193cf92b2c925a2f3f71a713d766efd1e4d81e0
Author: Simon Cornelius P. Umacob
Date: Tue Jan 20 15:52:39 2009 +0800
Merge IPv6 changes
commit 1f9f2a95b7b42cf33e730535092e56e214fdb848
Author: Simon Cornelius P. Umacob
Date: Tue Jan 20 14:55:07 2009 +0800
Merge IPv6 changes
commit ce996bd3014b05fea5eaffd7c738c5c549fd7677
Author: Simon Cornelius P. Umacob
Date: Tue Jan 20 14:30:27 2009 +0800
add IPv6.inc and NetUtils.js
...
% git reset --hard ce996bd3014b05fea5eaffd7c738c5c549fd7677
HEAD now points to ce996bd3...
To go back to the "original" HEAD, find its SHA1 hash and reset your current HEAD to that state.
% git reflog
simoncpu@pfsense:/home/pfsense/simoncpu-IPv6> git reflog
74fb85b... HEAD@{0}: pull git@rcs.pfsense.org:pfsense/mainline.git: Fast forward
9ce5e10... HEAD@{1}: commit: show/hide icmp6box
f193cf9... HEAD@{2}: commit: Merge IPv6 changes
1f9f2a9... HEAD@{3}: commit: Merge IPv6 changes
ce996bd... HEAD@{4}: commit: add IPv6.inc and NetUtils.js
cfc4dab... HEAD@{5}: clone: from http://gitweb.pfsense.org/pfsense/simoncpu-IPv6.git
% git reset --hard 74fb85b
Note that you need not use the full SHA1 string to refer to an object.
The first few characters is enough.
Wednesday, January 21, 2009
HOWTO Revert your Git repo to a certain commit
Friday, January 16, 2009
pfSense IPv6
I'm currently merging our IPv6 changes to pfSense by hand so that I can commit our changes upstream once their migration from CVS to git is complete.
"With a thousand eyes, all bugs are shallow", they say. Sharing this code to the world will most likely uncover many bugs and make our code more stable. I just hope that with a thousand eyes, I won't receive a thousand flak from users in case I break something.
I'll probably break something. :)
UPDATE: As of January 16, 2011, development has been stopped. If you wish to continue development, please contact me (simoncpu at gmail.com) or post a bounty. Thanks! :)
(whoah, I realized that this post was made exactly 2 years ago lol)
"With a thousand eyes, all bugs are shallow", they say. Sharing this code to the world will most likely uncover many bugs and make our code more stable. I just hope that with a thousand eyes, I won't receive a thousand flak from users in case I break something.
I'll probably break something. :)
UPDATE: As of January 16, 2011, development has been stopped. If you wish to continue development, please contact me (simoncpu at gmail.com) or post a bounty. Thanks! :)
(whoah, I realized that this post was made exactly 2 years ago lol)
Friday, January 09, 2009
HOWTO let lighttpd listen to both IPv4 and IPv6 requests on *BSD
Problem
When enabling IPv6 using server.use-ipv6 = "enable", lighttpd no longer listens to IPv4 requests.
Solution
Set a sysctl knob so that it will accept both IPv4 and IPv6 requests:
When enabling IPv6 using server.use-ipv6 = "enable", lighttpd no longer listens to IPv4 requests.
Solution
Set a sysctl knob so that it will accept both IPv4 and IPv6 requests:
root@soulfury:~# sysctl net.inet6.ip6.v6only=0
Tuesday, November 25, 2008
pf IPv4 and IPv6 shortcut
There's a shortcut for creating a pf rule that applies to both IPv4 and IPv6. E.g.:
pass in quick on em0 from { 192.168.86.0/24, 2001:418:c0de:babe::/64 } to any keep state label "experimentation"
Results in:
root@soulfury:~# pfctl -sr | grep experimentation
pass in quick on em0 inet from 192.168.86.0/24 to any flags S/SA keep state label "experimentation"
pass in quick on em0 inet6 from 2001:418:c0de:babe::/64 to any flags S/SA keep state label "experimentation"
pass in quick on em0 from { 192.168.86.0/24, 2001:418:c0de:babe::/64 } to any keep state label "experimentation"
Results in:
root@soulfury:~# pfctl -sr | grep experimentation
pass in quick on em0 inet from 192.168.86.0/24 to any flags S/SA keep state label "experimentation"
pass in quick on em0 inet6 from 2001:418:c0de:babe::/64 to any flags S/SA keep state label "experimentation"
Monday, November 24, 2008
Hello world from links
I forgot to bring my MacBook, so I'm now surfing the Net in a text-only browser inside a server. I'm surprised that Blogger works. Very cool.
Saturday, November 22, 2008
Acer 4330 Driver Installation
I'm continuing the setup for my Acer 4330 laptop. I gave up installing Windows XP because I don't have the time to hunt down the correct drivers. I've installed Windows Vista instead.
I'm annoyed with Vista's UI. Fortunately, I won't have to use this because I'll give this to my parents. Sorry mom and dad, I really don't have time to install XP. This is the best I can do.
The DVD provided with the laptop contains multiple drivers. I think Acer doesn't use a standard hardware for all of its laptops. I think they just choose the cheapest hardware available at the time of production.
Anyway, here are the drivers that worked for me:
Chipset - Intel Chipset
VGA - Intel VGA driver
Audio - Realtek (No need to install; it works after installing Vista. Install this if you want the volume buttons to work.)
Modem - Foxconn, probably, but I didn't install it
LAN - Realtek
TouchPad - ALPS Touchpad
Card Reader - I don't know; there was no need to install it.
Camera - There are 3 drivers (Suyin, Bison, and Chicony), but I didn't bother installing any of them. Please leave a comment if you know the correct one.
WLAN - Atheros
BlueTooth - the only driver, Foxconn, doesn't seem to work. I'm not sure if there's really a built-in Bluetooth in this laptop. There's a Bluetooth button, but this may have been reserved for other models.
I'm annoyed with Vista's UI. Fortunately, I won't have to use this because I'll give this to my parents. Sorry mom and dad, I really don't have time to install XP. This is the best I can do.
The DVD provided with the laptop contains multiple drivers. I think Acer doesn't use a standard hardware for all of its laptops. I think they just choose the cheapest hardware available at the time of production.
Anyway, here are the drivers that worked for me:
Chipset - Intel Chipset
VGA - Intel VGA driver
Audio - Realtek (No need to install; it works after installing Vista. Install this if you want the volume buttons to work.)
Modem - Foxconn, probably, but I didn't install it
LAN - Realtek
TouchPad - ALPS Touchpad
Card Reader - I don't know; there was no need to install it.
Camera - There are 3 drivers (Suyin, Bison, and Chicony), but I didn't bother installing any of them. Please leave a comment if you know the correct one.
WLAN - Atheros
BlueTooth - the only driver, Foxconn, doesn't seem to work. I'm not sure if there's really a built-in Bluetooth in this laptop. There's a Bluetooth button, but this may have been reserved for other models.
Friday, November 14, 2008
HOWTO Turn off DHCP Servers in VMware Linux
To turn off VMware's DHCP server in host-only network, simply find the appropriate DHCP process, and kill it:
root@soulfury:~# ps auxww | grep dhcp
root 5060 0.0 0.0 1892 252 ? Ss Nov10 0:00 /usr/bin/vmnet-dhcpd -cf /etc/vmware/vmnet8/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet8/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
root 5061 0.0 0.0 1888 520 ? Ss Nov10 0:00 /usr/bin/vmnet-dhcpd -cf /etc/vmware/vmnet1/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet1/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
root 21281 0.0 0.0 2796 748 pts/0 R+ 15:31 0:00 grep dhcp
root@soulfury:~# kill 5061
root@soulfury:~# ps auxww | grep dhcp
root 5060 0.0 0.0 1892 252 ? Ss Nov10 0:00 /usr/bin/vmnet-dhcpd -cf /etc/vmware/vmnet8/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet8/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
root 5061 0.0 0.0 1888 520 ? Ss Nov10 0:00 /usr/bin/vmnet-dhcpd -cf /etc/vmware/vmnet1/dhcpd/dhcpd.conf -lf /etc/vmware/vmnet1/dhcpd/dhcpd.leases -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
root 21281 0.0 0.0 2796 748 pts/0 R+ 15:31 0:00 grep dhcp
root@soulfury:~# kill 5061
Thursday, November 13, 2008
FreeBSD Problem: Can't see files/dirty state at each boot.
Weird problem. The filesystem is in an unclean state at each boot, even though I have ran fsck before booting the system. Initially, our problem is that our app can't "see" certain files at first read, although subsequent attempts on reading them are OK. Later, we discovered that the filesystem is dirty at each boot. The problem is similar to this issue in FreeBSD-CURRENT. We're using FreeBSD 7.0-RELEASE though, so I'm not sure if we have the same problem. I need to track this down.
Tuesday, November 04, 2008
PHP doesn't support dot characters in form names
I've written a PHP proxy script that communicates with an underlying application. I encountered a problem where the script is unable to proxy data that contains dot characters in the form name.
To illustrate:
Solution
I accessed the raw input stream directly instead of using $_POST:
To illustrate:
<?phpOutput:
var_dump($_POST);
?>
<form action="test.php" method="post">
<input name="this.is.a/variable" type="text" />
<input type="submit" />
</form>
array(1) {Notice the array key in the var_dump(); dots are converted into underscore.
["this_is_a/variable"]=>
string(0) ""
}
Solution
I accessed the raw input stream directly instead of using $_POST:
<?php
$data = file_get_contents("php://input");
$response = proxy_blah_blah($data);
?>
Tuesday, October 28, 2008
HOWTO Install Windows XP on Acer 4330
I bought an Acer Aspire 4330 a few days ago, but I couldn't install Windows XP. I think it's designed for Vista, but I don't want to use it because it's unusable. Windows XP Setup coredumped after a minutes, and I thought I had to slipstream the installation CD to solve this. Fortunately, a friend told me that all I had to do was to change my SATA mode from AHCI to IDE. The setup then went smoothly.
Installing the drivers is a PITA. The drivers in the provided DVD doesn't work because they're for Vista. I had to download the files from their FTP site.
Unfortunately, they provide multiple drivers for the same device. Do I need to use the driver for Atheros? Or Broadcom? Or Intel? Blah.
I'll continue installing the drivers tomorrow. I still have to finish this router/load balancer that I'm making. Hopefully, our connection would become twice as fast after we combine Bayantel and Globe connections. More on this later.
Monday, October 27, 2008
PHP's New Namespace Separator
I don't like PHP's new namespace separator. I prefer '::' to '\'.
Aaaaargh... why did they choose the escape character?
Aaaaargh... why did they choose the escape character?
Slow lighttpd using IPv6
I've been wondering why lighttpd seems to be so slow when IPv6 is enabled. I discovered that I had to bump the minimum and maximum number of FastCGI process (min-procs/max-procs) by twice as much because it appears that lighttpd divides the available PHP processes between IPv4 and IPv6. I dunno why it does that.
Thursday, October 16, 2008
How to destroy all gif interfaces in FreeBSD
To destroy all gif interfaces in FreeBSD (vanilla Bourne shell):
for i in `ifconfig -a | grep gif | grep -v '%' | sed -n -e 's/\(.*\):.*/\1/p'`; do
ifconfig $i destroy
done
Monday, October 13, 2008
Stuck DVD inside MacBook
A DVD got stuck inside my MacBook. What I did was to insert a prepaid card (it's made of plastic that's thin yet durable enough for this purpose) into the DVD slot, pushed it upwards and pressed the eject button. The DVD then came out.
Thursday, October 09, 2008
Looking for a used PC
I'm looking for a used Pentium III (or better) PC that I can use as a router/firewall. No need for monitor, keyboard, or CD-ROM. Just a CPU with enough hard disk and RAM. Please contact me if you have one. Cebu area only.
Wednesday, October 01, 2008
Library dependency woes
One of my Unix workstation is now fucked up due to forced installation of incompatible libraries. I guess I'll have to reformat it in order to start from a clean slate. I'm planning to temporarily transfer my files to my external harddisk, but FreeBSD can't seem to read it although it has been formatted as UFS. I formatted that harddisk on my Mac OS X laptop, thinking that it can be read in FreeBSD, but Mac OS X seems to have a different interpretation of what UFS is. Blah. I guess I need to reformat my external harddisk to FAT32 too. Oh wait. If I format it as FAT32, what would happen with my file permissions? Maybe I'll just use tar or something. Blah, blah, blah.
Wednesday, September 10, 2008
Google Chrome Browser on Mac OS X
While waiting for a Mac OS X version of the Chrome browser, I've content myself with VMWare Fusion's Unity feature instead:

Cool, huh?

Cool, huh?
Monday, July 07, 2008
Figlet Preview
Problem:
I wanted to use figlet but I can't decide which font to use.
Solution:
To inspect all fonts visually, simply do:
% cd /usr/local/share/figlet
% for i in `ls *.flf | sed -n -e 's/\(.*\)\.flf/\1/p'`; do echo Phuselage | figlet -f $i; done | less
Your mileage may vary; the font dir may be different on your operating system.
I wanted to use figlet but I can't decide which font to use.
Solution:
To inspect all fonts visually, simply do:
% cd /usr/local/share/figlet
% for i in `ls *.flf | sed -n -e 's/\(.*\)\.flf/\1/p'`; do echo Phuselage | figlet -f $i; done | less
Your mileage may vary; the font dir may be different on your operating system.
Friday, June 20, 2008
Synchronizing two CVS repositories using Mercurial
We're in a situation where we have access to some of our partner's source code. We need to keep in sync with their repo, otherwise our copy would quickly become stale.
Currently, we can do this manually because our changes are still small. A few months from now, however, our changes will eventually drift away from their code and merging it with our tree would become difficult.
A distributed version control system is in order. Here's how I did it:
In theory, exporting it back to CVS is no longer needed. In practice, however, I needed to maintain "compatibility" with my fellow developers who only use CVS. I hope we'll eventually migrate away from CVS though because merging lots of files is really time consuming. Merging/branching is CVS' main weakness.
Currently, we can do this manually because our changes are still small. A few months from now, however, our changes will eventually drift away from their code and merging it with our tree would become difficult.
A distributed version control system is in order. Here's how I did it:
+-----------------+ +------------+ +------------+ +----------------+
| Upstream | | Immutable | | Working | | Local |
| CVS repository |-------->| Mercurial |---------------->| Mercurial |-------->| CVS repository |
+-----------------+ import | repository | Mercurial pull | repository | export +----------------+
+------------+ +------------+
|^
||
||
v|
User
In theory, exporting it back to CVS is no longer needed. In practice, however, I needed to maintain "compatibility" with my fellow developers who only use CVS. I hope we'll eventually migrate away from CVS though because merging lots of files is really time consuming. Merging/branching is CVS' main weakness.
Subscribe to:
Posts (Atom)