785 reputation
29
bio website
location
age
visits member for 2 years, 1 month
seen yesterday

Dec
3
comment Linux - Is there a way to prevent/protect a file from being deleted even by root?
... I actually +1 this, I didn't knew about chattr +i file .. It's linux specific, but good to know.
Dec
3
comment Linux - Is there a way to prevent/protect a file from being deleted even by root?
Please note that whatever the right on the file is, if someone has the "w" right on the directory that holds that file, that person can delete/rename the file (in a simplified way: a filename is just a link to an inode, written in the directory's entry. You can unlink (rm) it if you can edit that directory's entry (=if you have w right on the directory itself). When a file doesn't have any remaining links to it, it's "deleted" (but opened fd to that file still are usable, until all fd to it are closed. The FileSystem usually only "frees" the space when all links & all fd to the file are gone)
Nov
21
awarded  Yearling
Nov
4
comment Mean Time Between Failures — SSD
Good sobering view that a 1'500'000 hours MTBF means really "If I have 1000 ssd like this one, 3 are likely to fail within 6 months (some even earlier than that) ..." . +1 (and as the tests are over a short period, expect the life span of those to not exceed too much the warranty... the "MTBF" probably drops a lot when your drive reaches N years old)
Sep
8
comment How to recover data from a messed up drive (LVM written on top of Ext4)?
Recover if you can, or restore from latest backup (... you do have backups, don't you? ^^)
Jul
3
comment How to continue redirecting stdout to a file after logrotate moves it?
I'd still recommend, in your case, to use ">>" instead of ">" if you intend to write to a truncated file : as ">>" open in append mode, it will seek until the end of the file each time it writes. That way, when you truncate the file (making it go from XXXX bytes to 0 bytes), it will "seek until end", so will know it now has to write after byte 0. Otherwise it may write after byte XXXX, and thus create a sparse file with XXXX null bytes before it (ie, when ">", the fd can just remember where it was in that file, and write from there, without realising the file size shrunk!)
Jun
11
revised Why not assign the hostname to the loopback address in /etc/hosts?
corrected typo on hostname, and added info on protocol, and emphasis on COULD as those infos are not sure but a big probability
Jun
11
comment Why not assign the hostname to the loopback address in /etc/hosts?
I remember SIP protocols causing all sort of problems with NAT between hosts in different WAN when the advertised adress needed to be the one NAT'ed to instead of the originator's IP (STUN could help). I believe (but can't be sure) it would cause problems if it advertise the loopback's ip instead of the host's ip while talking to other hosts on the same LAN. And I trust other protocols could be even more flaky (don't know whicn ones though). iow, it could cause problems "in some cases" (for an unknown range or even nature of cases...)
Jun
10
comment What's the advantage of synchronizing UID/GID across Linux machines?
Don't forget, when changing uid/gid, to update archives (tar files, etc.), and also conf files that may use numerical ids instead of uidname/groupnames.
Jun
10
answered Why not assign the hostname to the loopback address in /etc/hosts?
Jun
10
comment Why not assign the hostname to the loopback address in /etc/hosts?
It could be a bad idea, if you do have an ip (and communicate to other hosts). Some protocols could say "tell the other guy your hostname and its ip adress" "ok. Other guy, i'm sprinkler.internal.lan(127.0.0.1)". Additionnaly some services bind only on the interface holding the ip associated to the hostname and therefore will only be able to talk with the host, noone else...
Apr
7
comment Monday morning mistake: sudo rm -rf --no-preserve-root /
I was more trying to reduce the size of the file. But if you want to save bandwidth (good idea) : just add quotes: ssh root@host "cat /dev/sda | gzip -c - " > /path/to/dir_on_huge_partition/server.img.gz (the -c option of ssh is usually good too, but you'd still need to compress at the end, as ssh will only compress at entrance of its tunnel and uncompress before sending to stdout)
Apr
7
comment Monday morning mistake: sudo rm -rf --no-preserve-root /
an entertaining (and eye opening) read, if you don't have better tools at hand than the existing system and a few backups: ee.ryerson.ca/~elf/hack/recovery.html
Apr
7
comment Monday morning mistake: sudo rm -rf --no-preserve-root /
could maybe be : ssh root@host cat /dev/sda | gzip -c - > /path/to/dir_on_huge_partition/server.img.gz (the on-the-fly gzip will or won't help depending on what the content of the filesystem is...)
Apr
7
comment Monday morning mistake: sudo rm -rf --no-preserve-root /
@AmalMurali: you should add a note saying who you got that one from, though ^^ (= user22394)
Mar
13
comment Bash: two commands in dollar-parenthesis don't have same behavior
try to replace $(id -un) with $(/usr/bin/id -un)
Dec
17
comment How to forward traffic to VPN device
@Tomcelic: continuing the same way, on the destination host: does that host knows that DSL-ip is reachable through the destination-side vpn gateway? if not, add a route. Or (and it's probably better if you only vpn from DSL-side to the other side) : just add SNAT-ing on the OpenWRT VPN ip, so that packets going through it take that VPN's ip too, and therefore other side can reply to them
Dec
16
revised How to forward traffic to VPN device
added 1470 characters in body
Dec
16
answered How to forward traffic to VPN device
Dec
12
comment Is it possible to allow a machine on openvpn to connect to only one server on the network?
+1 for the helpful summary.