Reputation
15,757
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
17 47
Newest
 Nice Answer
Impact
~1.1m people reached

Nov
17
comment Why is the directory /lost+found 16K instead of 4K bytes?
It's simpler for fsck to just create a lost+found directory with more reserved space for found files than to expand it if/when needed. With some types of fs corruption, it may not even be possible or safe to expand the lost+found dir while fsck is fixing errors.
Nov
17
comment Busybox pager with color capability?
can you install GNU less on your windows box? or whatever it is you're using MobaXterm to connect to.
Nov
17
comment Editing my /etc/hosts.deny
not easily. more to the point, not cheaply if you're trying to conserve bandwidth and/or CPU power. there are iptables that can inspect the contents of a packet to make decisions on. and apache can be configured to reject requests with matching Referer: headers. You can even have apache redirect to a special page for requests with unwanted Referers (you'd need to enable mod_rewrite to do this)
Nov
17
revised Editing my /etc/hosts.deny
added mention of fail2ban and fail2ban description from the debian package
Nov
17
comment Editing my /etc/hosts.deny
yep. first matching rule wins.
Nov
17
comment Editing my /etc/hosts.deny
-I INPUT inserts the new rule at the top of the INPUT chain. -A INPUT adds it to the bottom of the chain. if -A INPUT didn't work, there must have been some other rule earlier in the chain which allowed those packets.
Nov
17
revised Editing my /etc/hosts.deny
added 30 characters in body
Nov
17
answered Editing my /etc/hosts.deny
Nov
17
answered Regex to match = followed by a newline so they both be deleted
Nov
17
comment How to extract data from a JSON file
json can't be reliably parsed with regular expressions any more than xml or html can. and most json data (e.g. fetched via a web api) doesn't come nicely formatted with extra line-feeds and indentation. to parse json reliably, you need a json parser. jq is one such for shell scripts. other languages have json parsing libraries.
Nov
17
reviewed Close copying and working on OSX .app files (folders) in linux
Nov
17
reviewed Leave Closed Append one file to two files in unix script
Nov
17
comment How to call bash function from within awk?
anonymous downvoter: if you're going to downvote, at least have the courtesy to explain why.
Nov
17
comment How to extract part of the line from the file
anonymous downvoter: if you're going to downvote, at least have the courtesy to explain why.
Nov
17
comment Apache CGI Workflow
Not quite right. apache just sets the environment variables and then execs the script. The kernel detects that it is a plain text script file (rather than a known binary executable format), examines the #! line and execs the specified interpreter (or the default, /bin/sh if there is no shebang).
Nov
17
revised How to extract data from a JSON file
added 161 characters in body
Nov
17
comment Is it possible somehow to tell if a laptop is moved in a bash or python script?
here's one with a micro-USB interface for about $8 USD. ebay.com.au/itm/… - it's just a circuit board so you'd want to seal it up with silicone or something. i'm surprised at how hard it was to find a cheap USB model. lots of expensive stuff for industrial computing applications. quite a lot of Arduino etc stuff. very few cheap USB models that you can just plug in to a laptop or desktop.
Nov
17
comment Is it possible somehow to tell if a laptop is moved in a bash or python script?
An accelerometer (which are fairly common in tablets and phones but not in laptops) would be much more sensitive than GPS...and would be able to detect when a laptop is picked up and put back in the same place. It would also detect when a clumsy cat jumps on the laptop. google for USB accelerometer. BTW, with some smart scripting you could use motion detected by an accelerometer to trigger taking a picture with the web cam.
Nov
17
comment Cant resize extended partition
the point of all this partition shuffling is so that you end up with the unallocated space immediately after /dev/sda5, so sda5 can be extended.
Nov
17
comment Cant resize extended partition
the unallocated space is before /dev/sda2. what i said means move /dev/sda2 so that the unallocated space is after it. optionally shrink sda2 at the same time.