Almost lost some work with git. I was using git reset --hard
to rewrite some history, but I forgot that I had some unstaged changes. Luckily, I had stashed it previously and still had the call in my terminal buffer, so I was able to get the object ID and apply it after verifying it was the right one with git stash -p show $ID
.
Computers & Tech posts page 11
Wow, the highest cost (31) bcrypt hashing of a password with PHP’s password_hash()
function is quite safe from brute force attacks from my laptop: It ran for almost 282 CPU minutes trying to compute one hash before I stopped it.
Apparently, setting a running Apple laptop on top of a closed one can cause the running one to sleep at random times. Must be magnets aligning.
Algorithmically derived passwords
I’ve been considering a new password storage method for a while now. Currently, I have a system where I compose passwords of pieces of several different values that I have memorized. Each value has a key that I have associated in my head to the value, and I have a file with the keys for each site. Lately, I’ve also been doing part of the password as something derived from the name of the site. This has helped somewhat with making the passwords memorable, but I still frequently have to look at my password file. If someone got a hold of this file, it would take some dedication and knowledge of me, or at least access to the plain texts of some of the passwords, to crack the system. Nevertheless, I’ve been looking for something easier to use and preferably more secure at the same time.
I’ve been looking at options like YubiKeys and 1password, but they have their issues. Today, I came across a cool option wherein passwords are algorithmically derived from a single password and the site name. This is sort of like what I’m doing in my head for some of my newer passwords, but much more advanced, able to produce hash passwords of a desired length and even with character constraints. I read about the idea from a post by Tab Atkins, who has his own solution freely available to use. The comments on his post also led me to SuperGenPass, a similar idea.
Both are of these options built purely using web technologies, making them easy to use anywhere. Both are open source, so I can check their code, verify they are doing what I want, and modify them so they can be slightly different. Neither need to store anything (unless you change the config for SuperGenPass) or require accounts. They have an option to work as a single-page file that can work even offline, wherein you type your master password and the name of the site, and they will give you the password in plain-text to copy elsewhere. SuperGenPass also has a bookmarklet option that can be run from the page you are entering the password on (obviously web only) by using an iframe (requires a third-party server) that can put the password directly into the password field, bypassing the need to copy the password at all.
So these are definitely interesting options to make working with passwords much easier, and the passwords I have for each site can be more complicated and theoretically secure than what I use currently. The biggest danger would be, if someone figures out my master password and what settings I’ve used for the generators, they will have access to any passwords I’ve created. I would probably do multiple master passwords, at least a normal one and an extra-secure one, just to limit the number of accounts they could access. I could even throw in a simple modification to the master password derived from the site name to make it even less of a problem.
Moving folder symlink and trailing slash
It caught me by surprise that if you use mv
on a symlink to a folder and have a trailing slash on the path, it will move the entire original folder rather than the symlink. As a simple example, if you have a symlink ‘symlink’ pointing to the folder ‘original’ and run mv symlink/ new-symlink
, you will end up with ‘original’ now being named ‘new-symlink’ and a symlink ‘symlink’ still pointing to the now non-existant ‘original’. Luckily, merely reversing the arguments will move the folder back to its original location: mv new-symlink symlink/
. The symlink becomes like a magic portal. I probably wouldn’t have run into this if it weren’t for the ‘fish’ shell adding trailing slashes when doing tab completions on folder paths or symlinks to them.
Command-line weather with wttr.in
Cool, lightweight, and simple ASCII weather forecast site that can be curl
ed: wttr.in. It does user-agent sniffing to show plain, colored text for curl
, wget
, and the like so that it looks nice on the command line, while browsers get HTML with a similar appearance. The “home page” does IP lookup to guess your location. Results of curl wttr.in/cleveland
:
Firefox tag groups removed
Firefox tag groups / panorama has been removed from Firefox proper. Luckily, they’ve moved the official source to a separate project as an extension called Tab Groups. The extension seems to function the same and migrated my existing tab groups to without trouble.
I guess there is benefit to having less code in the core Firefox project to maintain, but this is one of those cool features that sort of set Firefox apart from other browser. There is a Chrome bug requesting a similar feature that has 356 stars and comments praising the feature. Development apparently stopped in Firefox years ago, so maybe this split could actually increase development, but there’s always the chance that it doesn’t get updated to work with a new Firefox version at some point and disappears. At least the code is on Github.
I think the features has issues, such as slowness, moving around of groups when resizing windows, and a bit clunky of a UI, but is the best option I’ve seen for dealing with large numbers of web pages and multiple topics, particularly in the short term. Right now, I have 383 tabs in 28 groups, plus a dozen or so tabs in two other windows. Some of them I probably haven’t looked at in years. I think for long-term storage, local or “cloud” bookmarks are the best way to go. I’d like to work on moving most of my tabs to my delicious account, or better yet, my own site, but even then, I will want tab groups for day-to-day organization.
Raspberry Pi: playing with BerryBoot, RetroPie, and OpenElec
Played with my Raspberry Pi a bit more this weekend. I bought another micro-SD card and installed BerryBoot, a bootloader / OS installer sort of like Noobs, on it.
I installed RetroPie, a project that is built on top of Raspbian but with numerous emulators and a special interface that can be operated by a gamepad. It seems like it would be cool to condense all of my video game systems and even my oldest Mac (an SE) into a tiny box. Unfortunately, I wasn’t able to do much with it since I have to figure out how to get games onto it. It doesn’t have a web browser or other normal Linux stuff accessible from its special interface.
I also installed OpenElec, a media center. It has a dedicated interface meant to be operated by a remote control, though since I don’t have one of those, it operates a bit slowly by mouse. It has various media applications that can be installed from its interface, basically one for each of any online services. I installed quite a few and watched some old commercials on GetTV.
I’m thinking maybe I’ll eventually get a second Raspberry Pi to use as a media / gaming center. It’s easy to dual boot them using BerryBoot. It would be cooler if I could figure out a way to more easily switch between them, rather than rebooting. opensource++
I bought a rapberry pi with breadboard kit. Going to do some experiments. I may try it as a NAS, home web server, video game emulator, and media center. May get several for long-term use if I like them enough.
ls colors for both linux and bsd
ls
can have nice colors enabled to differentiate between file types easily, but the parameter is different between the BSD version (uses --color
) and the GNU Linux version (uses -G
). I have been setting up a “bash_profile”, among other things, to be shared between my users on all the POSIX computers I use. Some are Linux, some BSD based. I use Bash on both, and I wanted the colors from ls
to be used on both with the shared “bash_profile” file. I couldn’t find anyone else’s solution for this, so I figured one out myself and will post it in case others want the same versatility. I simply test ls
with one of the parameters and see if it throws an error. I then can set my aliases with the appropriate parameter. I do it like so:
ls --color > /dev/null 2>&1
if [ $? -eq 0 ]; then
alias l="ls -F --color"
alias ll="ls -lh --color"
else
alias l="ls -FG"
alias ll="ls -lhG"
fi