User talk:Nullspoon

Changing Sprint Phones After Changing Sprint Login
Error 67. Registration Failure. Your Sprint data service username and/or password may be incorrect. Please try again.


 * 1) 72786#

Recursion Example
traverseDirectory( '/var/' ); sub traverseDirectory { my $directory = $_[0]; my @contents = `ls $directory`;

# For all contents in the start directory foreach( my $content in @contents ) { if( isdir( $content ) ) { traverseDirectory( "$directory/$dir" ); }       }        return $directory; }

Postfix Handiness!
http://wiki.dovecot.org/HowTo/PostfixAndDovecotSASL

Kitteh
|\     _,,,---,,_ ZZZzz /,`.-'`'    -. ;-;;,_	    |,4-  ) )-,_. ,\ (  `'-'	    '---''(_/--'  `-'\_)

Fowarding All Traffic to Personal Router from CenturyLink Modem
We need static routing for this...

http://www.dd-wrt.com/wiki/index.php/Linking_Subnets_with_Static_Routes

Git: Bad Packed Object CRC
On run of, I see the following error:

Counting objects: 22284, done. Delta compression using up to 2 threads. error: bad packed object CRC for 20a48111646b52c7ecb8072d50a98450dff1de5e error: failed to read object 20a48111646b52c7ecb8072d50a98450dff1de5e at offset 40106998 from .git/objects/pack/pack-e04cd5aee5419d655f58ee67de508c12ad5be4cb.pack fatal: packed object 20a48111646b52c7ecb8072d50a98450dff1de5e (stored in .git/objects/pack/pack-e04cd5aee5419d655f58ee67de508c12ad5be4cb.pack) is corrupt error: failed to run repack

Securing a Box on an Unencrypted WiFi Network
I've heard it said (unfortunately both sarcastically and seriously) that the most secure box is one you can't get to. I am currently connected to a wireless network at a coffee shop that has set no password, therefore it has no encryption. How do we fix this?

...an SSH Socks proxy and iptables.

With this, you can effectively lock your box down entirely from outside traffic (try an nmap scan on your box to see) while still having complete outside access.

First up, open a socks proxy to an outside box you have running elsewhere. Mine is running at home and for obscurity purposes, I run my ssh server on port 443.

Once you've got that, import the following iptables profile...


 * 1) Generated by iptables-save v1.4.18 on Sat May  4 16:13:01 2013
 * filter
 * INPUT DROP [2192:135288]
 * FORWARD ACCEPT [0:0]
 * OUTPUT ACCEPT [6675:1759542]

-A INPUT -p udp -m udp --sport 53 -j ACCEPT -A INPUT -p tcp -m tcp --sport 443 -j ACCEPT -A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -p tcp -m tcp --dport 1080 -j ACCEPT -A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -p tcp -m tcp --sport 1080 -j ACCEPT COMMIT

This does a few things.
 * 1) It sucks because it's not transparent as it requires tsocks to redirect traffic on an application-by-application basis.
 * 2) It does nothing else for us because it sucks so much.

Let's just go ahead and abandon this method until we can find a seamless way to route all outbound traffic through localhost:1080 with iptables.

OpenShot: Exporting Video for Android
Okay, so it's not really just for Android. More it's for maximum compatibility. I haven't tested these settings on a Mac, but thus far the exported video will stream or download from a browser in Windows and Linux using IE, Firefox, or Chrome.

Prior to export, use the following settings in the Advanced tab.
 * Profile DVD NTSC
 * Video Format: mp4
 * Video Codec: libxvid
 * Bit Rate/Quality: You choose - I used 1.25 for size and time
 * Audio Codec: aac
 * Bit Rate/Quality': 128 kb/s - Good Quality

With these settings, I exported a 2 minute 15 second video to a 23.4 megabyte file.

Xrandr Configuration Script
A slightly less intelligent script.

A slightly more intelligent script. This will detect the quantity and type of monitors attached and will select the [hopefully] correct configuration for xrandr.

Document Digitization - Open Source Style
Okay, a few things to note before getting started here.

Firstly, I have to send out my thanks to many different projects in the open source community for contributing these pieces of software who's code is well beyond anything I could ever even dream of writing.
 * 1) Tesseract: An open source optical character recognition software that is tremendously accurate if given the right data. Does an impressive job of working with semi-skewed images (like bends in paper, nothing like a 90 degree turn).
 * 2) GNU packages: These guys have written some truly amazing stuff. For the purposes of this project, we will be using aspects of bash.
 * 3) ImageMagick: Used for batch image conversion (eg: bulk rotating in my case).

I also found that if your camera doesn't take the most crisp images or your lighting isn't perfect, decreasing brightness and increasing contrast on each image is a huge help. I used imagemagick for this. I also needed to rotate all of my images 270 degrees.

Another good workaround for this though is to just get a cheap $20 scanner at the store.

Setting Linux Password Complexity Constraints
I must confess, this is one area in which I am a bit disatisfied with the open source community on (I wish to send a nerf dart your direction!). Granted, most distributions have their default complexity set and that's that. Where's the documentation though? Well, here I am, a part of the open source community, and I'm complaining about how we don't document well enough. Well, here's a [hopefully good] document. :)

I had a fairly difficult time finding what I needed for this. Initial searches pointed me towards  and. Relating to default password constraints, login.defs only contains the default expiration information and minimum password length. system-auth-ac however, contains an requisite inclusion of a library called pam_cracklib.so. It turns out, when you read the man page for pam_cracklib, you find a sweet list of arguments for use when calling the library. Here's the man page excerpt (as of 2013.07.15)

debug
 * This option makes the module write information to syslog(3) indicating the behavior of the module (this option does not write password information to the log file).

authtok_type=XXX
 * The default action is for the module to use the following prompts when requesting passwords: "New UNIX password: " and "Retype UNIX password: ". The example word UNIX can be replaced with this option, by default it is empty.

retry=N
 * Prompt user at most N times before returning with error. The default is 1.

difok=N
 * This argument will change the default of 5 for the number of character changes in the new password that differentiate it from the old password.

minlen=N
 * The minimum acceptable size for the new password (plus one if credits are not disabled which is the default). In addition to the number of characters in the new password, credit (of +1 in length) is given for each different kind of character (other, upper, lower and digit). The default for this parameter is 9 which is good for a old style UNIX password all of the same type of character but may be too low to exploit the added security of a md5 system. Note that there is a pair of length limits in Cracklib itself, a "way too short" limit of 4 which is hard coded in and a defined limit (6) that will be checked without reference to minlen. If you want to allow passwords as short as 5 characters you should not use this module.

dcredit=N
 * (N >= 0) This is the maximum credit for having digits in the new password. If you have less than or N digits, each digit will count +1 towards meeting the current minlen value. The default for dcredit is 1 which is the recommended value for minlen less than 10.


 * (N < 0) This is the minimum number of digits that must be met for a new password.

ucredit=N
 * (N >= 0) This is the maximum credit for having upper case letters in the new password. If you have less than or N upper case letters each letter will count +1 towards meeting the current minlen value. The default for ucredit is 1 which is the recommended value for minlen less than 10.


 * (N < 0) This is the minimum number of upper case letters that must be met for a new password.

lcredit=N
 * (N >= 0) This is the maximum credit for having lower case letters in the new password. If you have less than or N lower case letters, each letter will count +1 towards meeting the current minlen value. The default for lcredit is 1 which is the recommended value for minlen less than 10.


 * (N < 0) This is the minimum number of lower case letters that must be met for a new password.

ocredit=N
 * (N >= 0) This is the maximum credit for having other characters in the new password. If you have less than or N other characters, each character will count +1 towards meeting the current minlen value. The default for ocredit is 1 which is the recommended value for minlen less than 10.


 * (N < 0) This is the minimum number of other characters that must be met for a new password.

minclass=N
 * The minimum number of required classes of characters for the new password. The default number is zero. The four classes are digits, upper and lower letters and other characters. The difference to the credit check is that a specific class if of characters is not required. Instead N out of four of the classes are required.

maxrepeat=N
 * Reject passwords which contain more than N same consecutive characters. The default is 0 which means that this check is disabled.

maxsequence=N
 * Reject passwords which contain monotonic character sequences longer than N. The default is 0 which means that this check is disabled. Examples of such sequence are ´12345´ or ´fedcb´. Note that most such passwords will not pass the simplicity check unless the sequence is only a minor part of the password.

maxclassrepeat=N
 * Reject passwords which contain more than N consecutive characters of the same class. The default is 0 which means that this check is disabled.

reject_username
 * Check whether the name of the user in straight or reversed form is contained in the new password. If it is found the new password is rejected.

gecoscheck
 * Check whether the words from the GECOS field (usualy full name of the user) longer than 3 characters in straight or reversed form are contained in the new password. If any such word is found the new password is rejected.

enforce_for_root
 * The module will return error on failed check also if the user changing the password is root. This option is off by default which means that just the message about the failed check is printed but root can change the password anyway.

use_authtok
 * This argument is used to force the module to not prompt the user for a new password but use the one provided by the previously stacked password module.

dictpath=/path/to/dict
 * Path to the cracklib dictionaries.

Use these arguments when pam_cracklib.so is included in /etc/pam.d/system-auth-ac and you should be set (I'm not sayin, I'm SUPERsayin!).

Best Recruiting Comany Names

 * SkillStorm
 * Prodigy Resources
 * Code Fellows
 * Ultimate Staffing
 * Slalom Consulting

Who comes up with these anyways?

Write Perl Script for Xkcd Substitutions
http://xkcd.com/1288/

Spaces
http://xkcd.com/1285/

Linux:Rescan SCSI Devices
If you're using Linux in a sizeable environment, you may be using fiber attached storage. If you have a new LUN presented to a Linux system and need to rescan because it's not being picked up, here's a quick bash one-liner to have all scsi busses rescanned.

That will echo "- - -" to the scan file for each scsi_host (scsi interface) on your system. Typically my new devices show up within a couple of seconds.

Command Line Random Wallpaper
This is a handy little oneliner I wrote this morning. I got tired of my background always being the same unless I changed it (those dang lazy Linux guys!), so I wrote this and set it to run on login. If you want to use this, you'll need the feh image viewer installed, but that package is only 400 and some-odd kilobytes. You might also want to change from jpg images to png or something else.

Also note that this assumes your wallpapers are all stored in the ~/Pictures/Wallpapers/ directory.