@Braiam Oh, I don't doubt it. That's why I upvoted Gille's idea (and some similar ones) I just would prefer to have what we have now, over not having anything.
@Braiam Yes and the main reason it doesn't work everywhere is that it fails on SO as far as I can tell. That, again, is because it has many more users so by extension many more dicks.
Bash Script:
Initially, I create a new file named people with all the persons name inside it.
cat people
john
jeff
emma
steve
julie
Now, I use the below script to select a person name at random.
random_character=$(cat ./dev/urandom | tr -cd 'sje' | head -c 10 | tail -c 1)
grep "$random_char...
C
It's important to decide who is buying as quickly as possible, so as not to waste precious drinking time - hence C is the obvious choice in order to get maximum performance:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
const char *buyer;
int n;
srand...
I was creating a new file system in my external HDD. While formatting, I had to format this partition to the remaining available partition which is somewhere around 850GB. Now, I created an ext3 file system in this partition. This is the output of my mkfs.ext3 command.
mkfs.ext3 /dev/sdb3
mke2f...
@casey - I don't think think so either - I tried it in the console, too. It has either something to do with my kernel version and the it way it handles pipes or with the version of tee that I have. It's weird.
But I used to see that text file busy error a lot which is what surprised me just now.
@Caleb well your goal is to run the m macro across all instances of pattern right? When recording the m macro, have the first action of the macro be /pattern, then the last action is @m
@Patrick Huh. I see. I still think that's a little brittle to setup an you can't do in a piece at a time, and :norm has other advantages such as operating on visual select ranges.
I have a cifs drive that I mount regularly, and it requires a password for it. Since it's annoying to type my password every time, I wrote a script that sets the PASSWD environment variable, mounts the drive, and then I clear it (cifs checks the PASSWD environment variable before asking).
It wo...
@slm, even if these packages are already installed, if the OP doesn't have root access, he won't be able to edit the /etc/nsswitch.conf and /etc/auto.master files right?
OK, very quick question... I found out I needed -I instead of -A on the rules to block them right away. I tried putting them further up the iptables.rules file. Where can I start the -I INPUT -s ip.add.re.ss/8 -j DROP entries?
@CanadianLuke I suggest you try denyhost. It should do all this for you:
DenyHosts is a python program that automatically blocks ssh attacks by adding entries to /etc/hosts.deny. DenyHosts will
also inform Linux administrators about offending hosts, attacked users and suspicious logins.
@CanadianLuke It shouln't really matter how high up the file they are. As long as you don't override them with a later rule, they should go into effect.
I set it to ban on 2 incorrect SSH attempts, but it never seemed to matter
@Caleb The "nat" table is not intended for filtering, the use of DROP is therefore inhibited.
Error occurred at line: 4
# more iptables.rules # Generated by iptables-save v1.4.14 on Wed Jun 18 08:03:11 2014 *nat :PREROUTING ACCEPT [60143:14159825] -I INPUT -s 166.0.0.0/8 -j DROP
Is it also necessary to specify the iptables rules in the correct order? i mean, if we have allowed some packets in the beginning of rule that rule would be processed before denying right?
Yeah I would agree w/ Patrick, it's better to deal with attacks via the firewall. I would try and dig in as to why fail2ban isn't working for you. Add some logging to confirm that the rules are working the way you think.
@Caleb Wouldn't it be the way to go though? If you want to block ssh login attempts, denyhosts and hosts.deny seem the right approach. I say this from the depths of my ignorance though, am I wrong?
@CanadianLuke According to its man page it's hosts.deny but if anyone has anything else to say, believe them. I am NOT an expert on this kind of thing.
@terdon Usually if you have the option you want to block stuff like that as far UP the software stack and networking chain as you can without breaking anything else.
@CanadianLuke It would do automatically what you were just trying to configure manually, which has some advantages. And you don't have to "hope" it works, either it does or it doesn't. If you configure it right it will.
@Braiam Yes it does. Ok, well that's what's confusing the color highlighting but I have no idea why that works. Some kind of weird esoteric perl syntax apparently.
AAA! It's giving two character classes!
Huh, cool. So, apparently, this is correct perl syntax:
@CanadianLuke Sure. For the sake of semi-private network or config details you can make it non-indexed with a short expiry; but it shouldn't be a real issue either way.
ugh, I have problems writing a tag excerpt for apt-mirror: > questions about the tool to mirror/clone Debian repositories, apt-mirror or > tool for mirroring Debian-based archives locally.
@terdon s[regexp][replacement] rather. In Perl, if the opening delimiter of s, m, q, etc. is an opening parenthesis/bracket/brace then the end of the quoted unit is the matching closing delimiter
You can write s[[[:alpha:]]]}uc$&}ge to uppercase a string. If you hate the next guy who'll read your script.
I mean, it'd be useful if it told you what type of questions to tag with that tag. Like, should I tag a question about using an apt-mirror repository, or only ones about configuring apt-mirror?
Hey, that might be a good job for a perl script. Go through an mbox file, and count the number of unique email addresses of the form number@bugs.debian.org. If I posted it, I bet it would get upvotes. People are mad about scripts here. Though I might get ticked off for not trying first.
ways to get amusing amount of spam: - give your email to whatever says it will give you something "free" when asked - publish your email in plain text online - send bugs to any bug tracker
I have a Lenovo G580 on which I installed Windows 8 and several linux distros which have messed with my booting.The last I used was boot-repair tool.
I have an EFI partition on sda2.The Grub load and I can boot to windows or Linux Mint or Mageia.
It seems now I cannot access BIOS by my regular F...
@marti Well, it doesn't reboot, it goes directly to the settings. But I confess I've only ever used the menu item (which just runs that command). I haven't actually tested typing fwsetup at the grub command prompt.
But it should work the same. I can test that on one of my UEFI machines tonight, if you'd like
I could flash it within windows.However if something goes wrong with the flash or with that efibootmgr command , I wont be able to boot anything and will get bricked
@marti On desktops its easy, you open it up and pull the battery. Not sure on laptops. Some are easy enough (pull the battery [the main one] and unplug from AC adapter, wait 10 minutes)
@marti Well, you can try F12 (or 10, or 11) to get a boot popup
you could also try some other keys to get into the setup menu (del, for example)
but in theory, once you remove all the boot entries, you're supposed to be able to get into the firmware setup menu again.... that's when you'd use the recovery disc
@derobert So, the idea is not to have people trying different servers in a single run, which might not be in sync? How long does apt remember the individual address, and how does it manage it? Caching?
@derobert Well, if it was deterministic with no input, it would always pick the same mirror. Does apt still do that, btw? Would make a good question here. Probably wouldn't be as popular as the cow one, though.
@FaheemMitha Well, it needs to always pick the same mirror on a particular machine, at least for a while. So you could always hash the machine name, or IP, or something like that to pick one. You want it to be different on different machines, of course, to prevent overloading one mirror.
this would only apply if one was to be using a pool like https.us.debian.org i guess
E.g.
host http.us.debian.org http.us.debian.org is an alias for ftp.us.debian.org. ftp.us.debian.org has address 64.50.236.52 ftp.us.debian.org has address 64.50.233.100 ftp.us.debian.org has address 128.61.240.89 ftp.us.debian.org has address 128.30.2.36 ftp.us.debian.org has IPv6 address 2610:148:1f10:3::89
@marti yes, definitely. Just like everyone else's. Yours just happened to have a bug you hit...
@marti Anyway, my suggestion is to leave it as-is for now. If it does stop booting, then I'd suggest a NVRAM reset by pulling all the batteries, followed by a firmware update if available.
My X server crashed for no reason. A bit worrying. Why would this happen? Maybe my graphics card is dying? It is quite old. The logs just said server terminated unexpectedly.