Just as an FYI, the Hungarian UPC's cable modem (Cisco EPC3925) is a piece oh sh*t. It lags, can't handle traffic bursts and is generally just a sorry excuse of a proper hardware device.
I turned it into bridge mode after numerous atrocities (losing packets on new connections, old ones work fine). Network just goes away for minutes, while cable modem stats look fine. Can't handle bursts/lots of small packets.
Now I have my raspberry pi do the routing using Linux and iptables. Performance is way better in every way. I especially had problems with DNS packets, it seemed that the device ran out of ram when I tried to resolve a lot of things at once. Funny, because every firewall and stateful inspection was turned off along with upnp and everything else.
If you have network problems at this ISP, you should consider switching their device into bridge mode and having a proper router sit behind it (need not be a raspberry).
Also their router sometimes makes a very high-pitched ~22khz sound, the fix is to disconnect and reconnect the antenna. Magnificent engineering indeed, thank you UPC for your customer service, fast response times and reliable operation all around. At least their prices are low, I guess that's what you get for $25/month.
BTW this piece of crap modem costs ~100usd if you lose it.
synapse's security blog
hacker: One who enjoys the intellectual challenge of creatively overcoming or circumventing limitations.
2013. május 19., vasárnap
2013. május 16., csütörtök
2013. május 12., vasárnap
2013. május 3., péntek
My first toptal article on Hackernews
Here it is guys. A tiny bit inaccurate, as it's been a while but quite an interesting read. More juicy things to come :)
https://news.ycombinator.com/item?id=5651008
https://news.ycombinator.com/item?id=5651008
2013. május 1., szerda
Synagogue porn
What the fuck!?
I stumbled on a site which gets a backlink from none other than the Synagogue on Franklet street. This site has a PR3 (not that bad) is linking to a LOT of porn sites. I'm not even kidding. Ahrefs is great, but unfortunately it does not tell everything to free users, so here are a few gems that you can find on the main page in the source:
In case you wonder what dry sex or video incesto might mean, well. I have no idea.
I stumbled on a site which gets a backlink from none other than the Synagogue on Franklet street. This site has a PR3 (not that bad) is linking to a LOT of porn sites. I'm not even kidding. Ahrefs is great, but unfortunately it does not tell everything to free users, so here are a few gems that you can find on the main page in the source:
In case you wonder what dry sex or video incesto might mean, well. I have no idea.
2013. április 30., kedd
Python pitfalls
First: beginner mistakes
Second: actual pitfalls
I've personally encountered several of these during my python career, including writing C in Python and struggling with default mutable arguments to name a few. If you read these and use Python, you'll thank me one day.
Here's another one for you by me: weakref pitfall
Second: actual pitfalls
I've personally encountered several of these during my python career, including writing C in Python and struggling with default mutable arguments to name a few. If you read these and use Python, you'll thank me one day.
Here's another one for you by me: weakref pitfall
2013. április 12., péntek
2013. március 28., csütörtök
2013. március 25., hétfő
Windows 7 + SSD + Partition table loss
The incident
Recently I bought a cheap Samsung 120G SSD as people say this is the best investment you can make. Oh, shouts out to bestbyte, they are fucking awesome, much better than Media Markt! I migrated my system and home, deleted the original (big mistake) and proceeded to boot it up. Everything worked fine, I had a 128M xfs primary for windows' boot stuff, 50G xfs for my system and home, and the rest 56 or so gigs for Win7.
I proceeded to boot up the installer, it saw the new ssd. I deleted the last partition and clicked install. Didn't work. Oh well, I thought it needs something at the start so I deleted the first 128M xfs and was particularly proud that I foresaw this happening. Didn't work. I tried repeating the process to no avail, thought it might be the linux cfdisk formatting and I wanted to check it out (alignment and etc). Reboot.
Grub error prompt, OS won't boot. Hmm. What is going on? Managed to boot up backtrack (which is not a really great distro but that's the only thing I had lying around), saw that there is a different partition table and my system+home is completely gone. Panic.
Start to nervously type commands, empty a usb hdd and start dd-ing the whole ssd. I wasn't completely freaked out as I knew that there's a 128M buffer at the start and probably just the partition table that's fried and maybe I can also get the data off the old drive. Even though I never did anything like that I was pretty sure I can find the xfs signature on the ssd and dd it out. Meanwhile friends arrived and we started to have a few drinks, I nervously mixed worrying and sipping whiskey.
The recovery
I thought the best way to figure this out is to check another xfs partition for signatures. _2501 was over here and recommended that I mount a loopback and create a small xfs and see what it does. So we did just that and concluded that we needed this (we grepped for xfs :)):
That's the XFS partition signature at the start of my other hdd. We grepped for it in the SSD and surely found a valid-looking one. This is the time where I curse myself for not saving the bash history from BT as I could illustrate my points.
After finding this, I took dd and after a few tries I managed to save the partition. I screwed something up as it didn't mount, I probably mixed up something because of the drinks. That night I started both a full backup of it to sda.disk and also a backup of the partition from the offset where I wanted it to system.disk. When I checked system.disk it was 90G as opposed to 50 (damn whiskey), but it mounted cleanly without errors and all my files were alive and well. Phew.
Probably I screwed up the size calculation and saved from a wrong offset and/or the volume was larger than what I saved. Since the xfs table stores the volume size, saving bigger volumes is always a good idea, so the 90G volume for sure included the end of my system partition.
Aftermath
Even though losing my home and system wouldn't be a catastrophe I wouldn't have been particularly happy about it. As later it turned out I had older backups of the important things, but still it was a great opportunity to flex my forensic muscles (huge overstatement). So all in all BACK everything that's dear to you THE FUCK UP otherwise you risk losing it because of the incompetent monkeys working at microsoft. As to why the win7 installer did this I have no clue, but as I've told this story to a few people, a surprisingly high number of them ran into this same problem.
After I backed everything up, I proceeded to install win7 where I deleted all the partitions. I created a 50gig one at the start, windows installed in 10 minutes. Booted backtrack, mkfs.xfs, moved the files back, mount, chroot, grub install. Fail, because grub is a fucking idiot and does not call sync().
I ran into this earlier, there's a bug report about it (WONTFIX obviously as they are out of their minds). It says that you have to call sync explicitly from the cmdline as they don't (sigh). I did it that way, works like a charm ever since.
Good thing to note here is that you can use this method whenver you manage to kill the file system table. Also as a protip, please leave 5 gigs at the start of the disk as a mistaken late night
synapse
Recently I bought a cheap Samsung 120G SSD as people say this is the best investment you can make. Oh, shouts out to bestbyte, they are fucking awesome, much better than Media Markt! I migrated my system and home, deleted the original (big mistake) and proceeded to boot it up. Everything worked fine, I had a 128M xfs primary for windows' boot stuff, 50G xfs for my system and home, and the rest 56 or so gigs for Win7.
I proceeded to boot up the installer, it saw the new ssd. I deleted the last partition and clicked install. Didn't work. Oh well, I thought it needs something at the start so I deleted the first 128M xfs and was particularly proud that I foresaw this happening. Didn't work. I tried repeating the process to no avail, thought it might be the linux cfdisk formatting and I wanted to check it out (alignment and etc). Reboot.
Grub error prompt, OS won't boot. Hmm. What is going on? Managed to boot up backtrack (which is not a really great distro but that's the only thing I had lying around), saw that there is a different partition table and my system+home is completely gone. Panic.
Start to nervously type commands, empty a usb hdd and start dd-ing the whole ssd. I wasn't completely freaked out as I knew that there's a 128M buffer at the start and probably just the partition table that's fried and maybe I can also get the data off the old drive. Even though I never did anything like that I was pretty sure I can find the xfs signature on the ssd and dd it out. Meanwhile friends arrived and we started to have a few drinks, I nervously mixed worrying and sipping whiskey.
The recovery
I thought the best way to figure this out is to check another xfs partition for signatures. _2501 was over here and recommended that I mount a loopback and create a small xfs and see what it does. So we did just that and concluded that we needed this (we grepped for xfs :)):
00007e00 58 46 53 42 00 00 10 00 00 00 00 00 00 ba 45 18 |XFSB..........E.|
That's the XFS partition signature at the start of my other hdd. We grepped for it in the SSD and surely found a valid-looking one. This is the time where I curse myself for not saving the bash history from BT as I could illustrate my points.
After finding this, I took dd and after a few tries I managed to save the partition. I screwed something up as it didn't mount, I probably mixed up something because of the drinks. That night I started both a full backup of it to sda.disk and also a backup of the partition from the offset where I wanted it to system.disk. When I checked system.disk it was 90G as opposed to 50 (damn whiskey), but it mounted cleanly without errors and all my files were alive and well. Phew.
Probably I screwed up the size calculation and saved from a wrong offset and/or the volume was larger than what I saved. Since the xfs table stores the volume size, saving bigger volumes is always a good idea, so the 90G volume for sure included the end of my system partition.
Aftermath
Even though losing my home and system wouldn't be a catastrophe I wouldn't have been particularly happy about it. As later it turned out I had older backups of the important things, but still it was a great opportunity to flex my forensic muscles (huge overstatement). So all in all BACK everything that's dear to you THE FUCK UP otherwise you risk losing it because of the incompetent monkeys working at microsoft. As to why the win7 installer did this I have no clue, but as I've told this story to a few people, a surprisingly high number of them ran into this same problem.
After I backed everything up, I proceeded to install win7 where I deleted all the partitions. I created a 50gig one at the start, windows installed in 10 minutes. Booted backtrack, mkfs.xfs, moved the files back, mount, chroot, grub install. Fail, because grub is a fucking idiot and does not call sync().
I ran into this earlier, there's a bug report about it (WONTFIX obviously as they are out of their minds). It says that you have to call sync explicitly from the cmdline as they don't (sigh). I did it that way, works like a charm ever since.
Good thing to note here is that you can use this method whenver you manage to kill the file system table. Also as a protip, please leave 5 gigs at the start of the disk as a mistaken late night
dd if=/dev/urandom of=/dev/sda(not /dev/sdb or wherever your usb disk is) can save your data if you Ctrl-C in time :) I did that once a few years ago, all I nuked was the windows partition as I usually put it first.
synapse
Feliratkozás:
Bejegyzések (Atom)
