Search Results: "ag"

12 December 2008

Francois Marier: Recovering lost git commits

Say you just deleted a branch or did a git reset --hard <earlier commit> and in the process lost a commit which you intended to keep.

Well, the good news is that unless you have run git gc to run a pass of garbage collection over your repo and get rid of objects which aren't linked to anymore, the objects for your lost commits should still be in the repo.

If you remember the SHA-1 IDs then you can simply use git cherry-pick to apply them to the current branch. However, if you don't have these commit IDs anymore, there is still a way to get to them.

This command will display all commits from the most recent to the oldest one:
git log -g

Biella Coleman: Craft Hackers

Craft Hackers is a panel being held tonight at the New Museum in NYC. Looks craftastic.
Craft Hackers is a panel discussion among artists who use crafting techniques to explore high-tech culture and the relationship between needlework and computer programming. Panelists include Cat Mazza, who translates moving images into stills knit in yarn; Christy Matson, who uses Jacquard Looms (some of the earliest computers) to knit landscape images from computer games; Ben Fino-Radin, whose witty needlepoint sculptures translate the World Wide Web into yarn and plastic, one pixel at a time; and Cody Trepte, whose embroidery of retired computer punch cards rekindles an old-fashioned love affair with the hand of the artist

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

Chris Lawrence: Corollary of the day

King Politics thinks the GOP anti-bailout faction has the politics of the day wrong:
The time for pragmatism is now, but Senate Republicans don t recognize that. Senate Republicans have yet to realize that the GOP lost so many seats in 2006 and 2008 because the American public has a greater desire for pragmatism than ideology.
I think that s true to a point but I suspect it has more to do with post-Katrina George W. Bush than any coherent definition of ideology. As much as the Democrats would like to pretend otherwise, ideological is not a term I d readily apply to the bumbling nature of Bush s second term. Nor am I really convinced that the average voter is doing much more than engaging in post-hoc rationalized-as-something-else economic voting, which doubtless makes me no fun at parties when I play a public opinion scholar. ( Yes, all this crap matters at the margins, and occasionally elections are won at the margins, but most of the time it doesn t matter. ) But I digress. There is a broader lesson, though, in that to the extent the Democrats believe that their recent success is due to their ideology it is at their long-term peril, particularly if they bypass pragmatism in favor of catering to the cobbled-together collection of rent-seekers that passes for the Democratic coalition. To the extent bailing out Detroit is seen as a Democatic handout to its paymasters particularly with the emerging frame of the greedy unions are standing in the way trumping any sort of concept that any deal that tells the UAW to can their contract is essentially an impairment of the obligation of contract (which, believe it or not, is unconstitutional) the auto bailout won t go over well in the 48 or so states that don t host significant Big Three production. On a related note, Steven Taylor notes the defining-down of the filibuster by the media to mean failure to win a cloture vote. While I accept the point graciously, I think this may be more a failure of us as a profession than the media per se; modern congressional procedures (not just filibusters and holds, but also esoterica such as the Rules Committee and UCAs), even superficially treated, aren t a strong point of most American government textbooks, and more often than not that s the only real government orientation budding journalists will get. I make a point of assigning Barbara Sinclair s Unorthodox Lawmaking in my Congress classes, but I doubt the average journalist gets that in-depth in their undergrad days. So here at least I think the blame falls somewhat closer to home than we might want to admit.

Adrian von Bidder: SSH VPN

Yes, this is just to bookmark what Romain contributed. VPNs can be created by ssh plus tun devices; debian-administration.org has a very nice write-up including proper set up of the authorized_keys file to not allow generic ssh root access. Please, can everybody add big disclaimers on all ssh + ppp based HOWTO's that this is obsolete? Or is there a reason I'm still doing it that way other than the omnipresence of said documentation?

Romain Beauxis: VPN using SSH

There seems to be indeed a meme on the various use of SSH. So far I ve not seem mine, so here it is ! If you use the -w option when connecting using SSH, and if you have the correct configuration, then two virtual network interfaces will be created on both the client and the server. Using these interfaces with a bit of routing and resolving magic, you can establish a full connection tunneled through an SSH connection !

Michal &#268;iha&#345;: Kozlovna - great beer and food

After more than one year, I decided it's time to resurrect pub reviews category on my blog. The delay was partly caused by my half year trip to Japan meanwhile and lack of motivation to blog, but I think now I'm ready to push some more reviews. This time I'll recommend Kozlovna (sorry no web pages exists, address is Lidick 20, 150 00 Praha 5). I randomly found it when walking in the city centre and I was really positively surprised by quality of beer (Velkopopovick Kozel 11 Medium), food and service. On my first visit I had great ribs, on second deer fillets and both were just delicious. The interior perfectly matches name of the restaurant and the brewery which ships the beer (Kozel = billy-goat) and you can find horns or goat shapes all around. Another plus is that half of the restaurant is non smoking, so you don't have to smell that ugly smoke.

Adrian von Bidder: Adult content?

The best way to get me to read a blog entry you've made is to apologize about it in the next one ... So I've gone and clicked on the link to Amaya's previous entry. Getting a warning that I'm about to be presented with a page that may contain material only suitable for adults. What the hell, Amaya is an adult and so am I, so let's just confirm this. I was truly shocked to see her entry that indeed did contain the extremely dangerous word “love” in it (can't imagine what else may have triggered the filter.) Together with Youtube's apparent tightening of their filtering (I'd not have noticed except that Illiad commented on it) it seems the Intarwebs are now being converted to a happy teletubby-land. So I'm forced append this disclaimer now: Attention please, the text you've just read may have contained strong words, opinions, sentences, punctuation characters and all kinds of dangerous information only suitable for inhabitants of a small planet somewhere in the vicinity of Betelgeuse.

Joey Hess: wherein I read too much

  1. Dishwasher, by Pete Jordan
  2. Windfalls, by Jean Hegland
  3. River of Gods, by Ian McDonald
  4. Powers, by Le Guin
  5. Real World Haskell, by O'Sullivan, Goerzen, Stewart
  6. Matter, by Iain M. Banks
  7. Ars Magica, by Tweet & Rein Hagen
Nice set of books. Pity I'm in the middle of all of them. Lately I have a hard time finishing many novels, I think because waiting for the plot to play out gets boring. Although River of Gods has mostly just confused me with too many viewpoint characters. And by this, where each box is a chapter, and that big box I'm just at the start of scares me: Dishwasher is fun light reading. If I'd thought to bring it to its owner, Jay, who misplaced it, I could have picked it up from where I left off months ago and read it on the plane. Double oops. Oh well, there's always my next doctor or dentist appointment. Powers is a probably great book by Le Guin. I hope there are many more to come, but the tendancy is to savor what's available. Also, I have it in dead tree edition, which I tend to save up for when I need them. Windfalls is such a dead tree book, hibernating in the yurt for me to get back to them some day. I may have to start it over, since it's pretty involved, and rather out of my usual comfort zone. Real World Haskell is coming along well, I hope. Matter hasn't pulled me in yet, oddly. Ars Magica I've been flipping through the PDF of idly.
Anyway, after all that, turning up a random story generator in 1 kilobyte of code couldn't help but feel like a relief.

Matthew Palmer: ETOOMUCHMAGIC

I'm a fairly big fan of the Rails web development framework; it uses a programming language I quite enjoy using, and deals with the "bureaucratic" overhead of writing a web application with minimal fuss, leaving me to think about the things that matter -- my application's functionality. To achieve this wonderous feat[1], Rails has a healthy injection of magic in the codebase, to do all sorts of interesting things, like autoload missing constants, and make intelligent guesses about what I want to happen in various situations. The problem comes when you want to reuse this magical code for something else. I'm working on a project at the moment where a bunch of the utility functions that are in the ActiveSupport gemlibrary would come in real handy. Well, that's OK, it's a separate gemlibrary from the rest of Rails, I'll just load it into my app, and I'm away. Or... not. The problem is that it would appear that a lot of the magic in the library is mandatory. Regardless of whether I want your constant autoloading magic, I've got it. I also can't just easily pick-and-mix the parts of the ActiveSupport library that I want, because there's all sorts of dependencies between the different chunks of the code that aren't expressed the "right way" -- everything gets loaded in the top-level active_support.rb, rather than being depended on by the files that need the classes. This is arguably a bug in ActiveSupport, but it's not something that's likely to be real high on anyone's annoyance list (since in practice ActiveSupport is a part of Rails, and when you use it in Rails it works Just Fine). So, to all programmers: magic is great, but be careful about excessive magic. In particular, don't make magic happen in places that the user didn't ask for, and allow people to turn off your magic when it's counter-productive to their purposes.
[1] This feat becomes more and more wonderous to me every time I look at the other available web development frameworks out there, especially ones in other languages. Despite having Rails to rip offtake inspiration from, they still seem to require a lot of boilerplate to achieve their goals. While there's a limited amount of boilerplate stripping you could do for a C program, Python people keep telling me that their language is just as powerful as Ruby -- and yet all the Python web framework usage I see is chock full of unnecessary cruft.

Peter Makholm: Automatic reporting of worktime

Some time ago I used gtimelog to keep track of my working time. I added an entry when I arrived in the morning and an entry when I left work in the evening. But quite often I forgot to add an entry and after a while I stopped keeping track of how much I worked. Tracking login and logout times could be confusing, but normally I turn my work station off when I m leaving work. So if I keep track of it s uptime during a week I (almost) have my working hours. Fortunately Linux already keeps track of this with the wtmp file. So I just have to parse this and presto my working hours for the last week
makholm@makholm:~$ worktime "00:00 a week ago" "00:00 today"
Fri Dec  5 08:19 - worked 07:36
Mon Dec  8 07:05 - worked 09:03
Tue Dec  9 09:10 - worked 00:01
Tue Dec  9 09:11 - worked 08:40
Wed Dec 10 07:33 - worked 08:33
Thu Dec 11 07:04 - worked 02:51
Thu Dec 11 10:43 - worked 06:12
                          -----
             total worked 43:00
makholm@makholm:~$
A simple cron script called monday morning should provide me with a weekly mail reporting how much I ve worked the week before. The worktime script is quite simple and uses Sys::Utmp to parse wtmp. Update: improved version

MJ Ray: Global 300 and chances to invest in a fuel co-op or meet Cooperatives-SW

The new Global 300 list has been released this week:-
the 300 top co-operatives are responsible for an aggregate turnover of 1.1 trillion USD which makes it the size of the 10th economy of the world nearly the size of the Spanish economy. The list also shows that co-operatives are growing in terms of turnover 14%
Also, the Good Fuel Co-operative (a consortium established early in 2008 by five UK biodiesel cooperatives: Goldenfuels, Sundance Renewables, Magpie Recycling, Bolton Alternative Fuels Co-operative and Biofuels.org.uk) has launched a share issue to raise 420,000 to fuel the growth of the biodiesel market. Finally, Cooperatives-SW board will meet in Exeter in January and the AGM will be in Plymouth in April - so if you d like me to let you know the dates when they re announced (for meeting up or otherwise), please leave a comment on this post and tick the Notify me of followup comments box. Thanks!

11 December 2008

Junichi Uekawa: iPod Touch Remote.

iPod Touch Remote. Craft a webserver application on your MacBook. Create a web page with two buttons, up and down. Using Xtest, handle up button with a PgUp key, and down button with a PgDn key. Connect to your webserver using iPodTouch, and voila, you have a iPodTouch remote controlling your presentation. Prepare your MacBook with avahi so that you can connect with random wireless environment. The up/down picture is not good, looking for better contributions. Source available from git clone git://git.debian.org/git/tokyodebian/monthly-report.git, utils/ipodtouchremote

Russell Coker: Please Turn off Your Spam Protection

Hi, I’d like to send an email from a small domain that you’ve never heard of or from a big ISP that’s known for being slack about spam (*), I can’t send the mail to you because of your anti-spam measures. I think that this is unfair, it’s discrimination, and you are cutting off your nose to spite your face in rejecting my mail. So please reconfigure your mail server now and accept more spam in your inbox, my message is important enough to justify the extra time you will spend manually deleting mail and the risk of accidentally deleting legitimate mail while deleting heaps of spam (I am in fact more important than you). By not accepting my mail you are being an asshole. I only receive a dozen spam messages a day and I don’t mind it, without even knowing you or having bothered to do a web search to see how well your email address is known I’m sure that you don’t receive any more spam than me and therefore you too can turn off most anti-spam measures and manually sort through the spam. You don’t really have a problem with spam, you are just paranoid, I’m sure that you installed your anti-spam measures before receiving any spam and then never bothered to check the hit rates. My sys-admin knows that one of the DNSBLs has an old entry from when his server was broken, but he won’t request that it be removed - so you can change your server because my sys-admin doesn’t want to click on a URL that you sent him. The RFC-ignorant.org service is used and run by ignorant people - I know this without even reading their web site to discover how it works. The above is a summary of a number of complaints that I have received about my anti-spam measures. I’ve para-phrased them so that they make sense, I have not actually had someone directly say “I’m more important than you so you should just accept more spam”, but the implication is quite clear. Now there are some legitimate reasons for requesting that anti-spam measures be reduced. In the distant past almost everyone had working reverse DNS entries which matched the forward entries and it was common to reject mail from systems that didn’t have valid DNS. Nowadays there are many big ISPs that delegate IP address space without permitting reverse DNS entries, and there are companies that have one department in charge of IP addresses (who don’t have a clue about reverse DNS) and another department running mail servers (who are cluefull). So the environment has changed to make reverse DNS checks a non-viable anti-spam measure. Requesting that people remove such checks is reasonable. Anti-spam measures that attack innocent third parties are bad. Sending “warnings” about viruses has made no sense for many years as all modern viruses fake the sender address, an employee of one company once admitted to me that they were sending out anti-virus “warning” messages as a way of sending unsolicited advertising to random people (I reported them as a spam source). Some time ago on a routine upgrade of ClamAV I accidentally copied in a default configuration file that made it send such warnings - I was grateful when someone informed me of my mistake so that I could fix it. Challenge-response is another technology that causes harm to others. I think it makes a lot of sense for mailing lists (every modern list server will confirm subscription requests), while it does result in sending unwanted mail to innocent third parties (every time a new virus becomes prevalent I receive a number of confirmation messages from list servers), but it’s not something that I will use on a regular email account (but I am prepared to do paid work implementing CR for other people). Requesting that manually implemented blocks be removed is quite reasonable. Occasionally I find that mail from one of my servers is blocked because a previous owner of the IP address space did bad things. In such a situation it is quite reasonable to provide an assurance that the new owner takes abuse issues seriously and to request that the block be removed. Requesting that I make any change to my system without making a minimal effort to get your broken mail server fixed is totally unreasonable. If the system administrator is not prepared to click on a URL to get their system removed from a black-list or if the user is unwilling to report the problem to the sysadmin then I will probably be unwilling to make any change to my system. The only exceptions to this rule are for clients, colleagues, and for people who use mail services that are large and unresponsive to users (IE the users don’t directly pay). I recently made a white-list entry for a large European ISP that is used by a Debian Developer for their work, as the ISP is known to be unresponsive to requests and mail related to Debian work is important to me I added a white-list entry. One thing I am planning to do is to document my anti-spam measures and then allow people the opportunity of suggesting new anti-spam measures that I haven’t tried yet if they want me to turn off any of my current protections. (*) I’m not aware of any big ISP that takes strong measures against spamming customers and customers whose computers are trojaned. I am aware of one having done it in the past, but I suspect that they may have ceased doing so after their brush with bankruptcy. I suspect that many ISPs simply rate-limit their customers connections to the outbound mail relays and hope that they don’t get enough infected customers at any time to get themselves listed as a spam source.

Martin F. Krafft: Init7 and Transtec please me

Init Seven has once again established themselves high on my ranking of awesome service providers. After battling and not resolving the problems with crap nVidia hardware, I was ready to return the server to Transtec, despite having invested a full day of work into it. Having a machine in a rack across town, with the looming danger of simple network traffic taking out the network card along with the bridged IPMI remote console (thus requiring me to head out to the colocation centre each time there was a problem) was just not going to justify the expense for the server. Init Seven connected a second switch port to my VLAN, which now allows me to hook the IPMI card directly to the LAN. This does not solve the problem with the sub-zero-quality crap manufactured by nVidia, but at least it makes it possible to resurrect the machine remotely, until the problem with the hardware has been addressed and dealt with by the forcedeth driver. And if that is not possible (due to nVidia pile of shit), then the last option is a separate network card attached to the riser card slot. In related news: Transtec was quick to proxy to the Supermicro s support (the motherboard manufacturer), and within a few hours, I had a newer forcedeth.c file. I compiled the driver, which seemed to handle larger packets just fine at first. Unfortunately, just as my hopes were up, the problems came back even with the driver from Supermicro. Back to start, do not collect any money. Regardless, I ve been impressed by Transtec s support level so far. Yes, I did purchase a five year express warranty extension, but it wasn t very expensive, definitely nowhere near the price for a real SLA. And yet, my requests to date have each been answered within a day at most, including such extravagant things as them providing doanloadable floppy images of the BIOS update, which Supermicro only distributes as Windows .exe file. Now if only they (and everyone else) would stop shipping nVidia hardware NP: AC/DC: Dirty Deeds Done Dirt Cheap

Alastair McKinstry: Splint - compiler warnings

I was installing SPlint - Secure Programming Lint - on our new machine at ICHEC yesterday, when:
Compiling flags.c...
flags.c(151): warning #1011: missing return statement at end of non-void function "argcode_unparse"
          
  ^
flags.c(265): warning #188: enumerated type mixed with another type
    allFlagCodes (code)
    ^
flags.c(292): warning #188: enumerated type mixed with another type
    allFlags (f)
    ^
flags.c(390): warning #188: enumerated type mixed with another type
    allFlags (f)
    ^
flags.c(459): warning #188: enumerated type mixed with another type
    allFlags (f)
    ^
...
Compiler warnings from a Lint tool. A commercial compiler (Intel) admittedly, but nevertheless.

read more

Tags , ,

Biella Coleman: Geek girl list

Many many (great) additions/clarifications have been made the Geek Girl list in the comments about geek representations in mainstream media. Two of the most important additions/comments were 1) “One glaring omission is Lisa Simpson” (Could not agree more ) 2) “Gadget was a mouse, not a chipmunk!” :-) Also, for those that may not know, here is Nerd Girls, which I have written about in the past and really deserves to be part of this conversation. I have added some more comments and thoughts but below in the comment section.

MJ Ray: Smart Tricks with ssh

  1. Host *
    ControlPath ~/.ssh/sock/%r@%h:%p
    ControlMaster auto

    from Nijel’s weblog: Speed up SSH logins - is there any disadvantage to this? Also, “completition” is a great typo along the lines of my frequent “abou tit” one.
  2. ServerAliveInterval 3600 for reasons explained in the comments here.
  3. Anything you like on the Standalone Sysadmin SSH series (ok, I cheated to get a list of three…)

Ross Burton: SSH Tip Of The Day

Do you regularly ssh into machines which have dynamic IP addresses, and get really annoyed with OpenSSH warning that the IP's key doesn't match the host key? I certainly do, with machines announce their names using mDNS and a DHCP server in my router. Today I finally checked the documentation and found out how to skip this check. The magic option is CheckHostIP, which you can set in .ssh/config on a per-host level. I've got this in my config:
Host *.local
  CheckHostIP no
Now all machines I ssh into using a .local domain won't have their IP's key checked against the host key, because the IP is dynamic. Sorted! NP: Music Like Amon Tobin, Last.fm

Russell Coker: Toy Helicopter


I have just bought myself a toy helicopter. I had been tempted to buy one for a while and when I saw them on sale for $30 I couldn’t resist. My helicopter is model FJ-702 from Flyor, it is controlled by infra-red and is designed for indoor use only. It seems that the trick to flying one is to control the rate of ascent and descent. If the helicopter rises too fast then it may bounce off the ceiling which results in it swaying uncontrollably and crash-landing. If it is allowed to descend too fast then it becomes impossible to slow the rate of descent, I suspect that this is the settling with power [2] problem that is documented in Wikipedia. The helicopter is very fragile, I broke one of the skids and part of the tail assembly before I learned how to control it properly. Probably the main thing to look for when buying a model helicopter is a solid design - some time after buying (and breaking) my helicopter I visited the shop which sold it and heard the owner advising other customers to buy the $45 model which is apparently more solid. It seems that an ideal design would be a frame made of spring-steel (not to make it springy but to avoid it breaking when it hits). I recommend flying in a room with a carpeted floor, bouncing off a solid surface such as a wood floor will break a helicopter. Controlling a helicopter is really difficult. The models that I have tried and seen demonstrated all have serious problems with unwanted rotation. My helicopter and the others I have seen have coaxial rotors to avoid rotation without a tail rotor. According to the Wikipedia page a lot of energy is used by a tail rotor [1], as there has been obvious difficulty in designing the helicopter with adequate power (in terms of the light and weak frame and the short battery life) it seems that they didn’t use the tail rotor design to save energy. It’s a pity that instead the designers couldn’t have skipped the flashing LEDs etc. One strange thing is that one pair of blades can have their angle changed (which appears to be similar to the “semirigid” design shown on the wikipedia page). I’m not sure how increasing the angle of one blade while simultaneously decreasing the angle of it’s pair will do any good. I expect that this has something to do with the fact that the helicopter will rotate at different rates when under different amounts of vertical thrust. This incidentally makes it almost impossible to maneuver the craft. It has a tail rotor on a vertical axis to control forward and reverse movements, but the extreme difficulty in keeping it facing in one direction makes this almost useless. I wonder what the minimum size at which a gyro-stabiliser becomes practical. But as Wikipedia doesn’t document the existence of an autopilot for full size helicopters the chance of getting one for a toy is small. In summary, while I have had $30 of fun, I think that a more solid helicopter would be a better investment.

Next.

Previous.