3 Comments

(ar)ch (pa)ckages – a generic package tasks script for Arch Linux

I once saw a wrapper-script for pacman in the forums that was basically a short-hand version of common pacman tasks. I thought this was a good idea and over the last couple years, I’ve expanded on it. It does just about everything I need it to. It’s real basic and I call it arpa. Here is a basic synopsis:

arpa [option] [*package] - a generic package tasks wrapper script
  -e, --explicit - install a package as explicit
  -g, --get      - get/download package upgrade(s)    : -G get pkg upgrades all
  -i, --install  - install a package                  : -I install as dependency
  -l, --list     - list package files                 : -L list pkgs installed
  -o, --owns     - owning package of a file
  -q, --query    - query for an installed package     : -Q query w/ description
  -r, --remove   - remove a pkg and its deps          : -R force, no argue orphs
  -s, --search   - search for a package               : -S search w/ description
  -u, --upgrade  - upgrade system                     : -U upgrade AUR
  -y, --sync     - sync package db

Good for me to have this around so I can remember everything :), and it is in the AUR.

Leave a comment

Embedded Scripts in WordPress with GitHub Gist and Update Script

I asked at Stack Overflow recently if I could embed a text file into a webpage. My reason was basic: I wanted to be able to use my newly created GitHub script repository to be my source for scripts I posted on this blog. If I was able to do this, I reasoned, than my script on the blog will be up-to-date when I updated my GitHub repository. Unfortunately, there appears to be no direct way to do this that I could find so I look for an alternative and found GitHub Gist. GitHub Gist’s description:

Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.

I was hoping that there would be a way to link a script but there isn’t. Basically the standard process it to visit the GitHub Gist WebUI paste the script, config, … and then post the link on its own line into WordPress.

Because this creates git repository it means it can be updated. So I wrote a script does two functions: 1) Creates a repository for a file; 2) updates all files listed in the script with a Gist repository.

Works pretty good, there are a couple caveats though. First, Gist does not recognize the interpreter on the first line of a script and instead uses the extension. I tend not to use the .sh extension but I wanted syntax highlighting so the script on the blog now are labeled as name.sh which I guess isn’t a huge deal. Second, each script must have it’s own repository or all the scripts, configs… would be placed when put into a post. Not sure if this a breach of etiquette but I think I’m ok.

The script requires defunkts excellent gist command line upload tool.

The syntax is such:

 ghsync-gist   - Add or update gist repo(s)
  a - Add gist repo for file(s)
  u - Update all gist repos for all files

1 Comment

YouTube from the command line

How to play YouTube videos became a question to me because flash in Linux is all but abandoned and knowing of flash security concerns. Good news is that most videos now are being converted to WebM (Firefox HTML 5 video) but for some unknown reason I find most of them that the sound won’t play. I really enjoyed watching YouTube videos so since I’ve gone to using youtube-dl which is a great command line program (there is also youtube-viewer).

I wrote a wrapper script do that to be able to download a number of varying videos:

youdl 
 youdl "youtube.com/url" # quotes necessary, not spaces

youtube-dl

I like youtube-dl quite a bit too but it takes more setting up. When using youtube-dl I put these in my ~/.bashrc to simplify the process:

utube-view () {
  mplayer -cache 200 -really-quiet $(youtube-dl -g --max-quality mp4 "$@" )     
}

youtube-viewer

youtube-viewer directly invokes mplayer:

youtube-viewer "http://youtube.com/video-url"

And it works great! The quotes are necessary to avoid bash interpretation of specialcharacters. youtube-viewer can also download the video too:

youtube-viewer -d "http://youtube.com/video-url"

MPlayer Keyboard Shortcuts

Got this from here:

Leave a comment

Back to Blue

Well, I got my Arch installed again and it feels good. I’d been working in Ubuntu for awhile because my older laptop had problems with suspend (that I desperately needed) that I couldn’t figure out in Arch and because of serious time constraints. Being back though, I forgot how much I missed the simplicity and straightforwardness of Arch. I had built a helper script for Ubuntu/Debian that could do just about anything but it took awhile to get there. So far on Arch I’ve actually done a lot less bug fixing, tracking down issue take less time, and with the AUR all the packages are there.

I’d been fixing bits in the wiki as I gone through setup (which is still doing great Misfit) and was able to re-write and add considerably to the MiniDLNA today. Feels good.

Leave a comment

crontab

1 Comment

Managing Scripts and Configurations on Github with a script

This post is a follow-up to Michael Smalley’s excellent post on how to manage your dotfiles.

Use Git and Github to Manage Your Dotfiles. I wanted a way to regularly have my configurations and scripts updated on Github that didn’t require me remembering how to do it :). So I created a script that would do it for me:

Works pretty good. Then I put these in my crontab to have them updated every week.

6 Comments

Acer Aspire 5560G-7809 Laptop: A Gamble Worth Taking

Typically it hasn’t been recommended to buy an Acer, at least in my circles. From the surveys I’ve seen generally Acer rankings are last of the major computer manufacturers. Astonishingly they rank close to the top of units sold. When I saw this, I deduced that Acer likely made possibly shabby computers sold at basement-prices to a portion of the population that was virgin. So I’m not sure what I was thinking when I bought my Aspire laptop except, “If that’s true, thats a really good price; I have to have it.” I had been using a ten-year-old laptop up to now so this was by best shot to the moon orbit.

I heard about laptops that were “Desktop Replacements”. I was hoping to find something in that area: a powerful-ish core in a mobile unit (with a decent gaming card). I’m not sure the Aspire 5560G-7809 [1][2] would qualify as one officially but performance in Windows and Linux is good (at least as best as I can qualify from a 10-year-old laptop perspective). The basic specs:

Specifications
Processor AMD A6-3420M Quad-core 1.50 GHz
Memory 4GB DDR3-1066/PC3-8500
Hard Drive 320 GB SATA 5400rpm
Optical Disk DVD-RAM/±R/±RW-Writer
Screen 15.6″ 1366 x 768 Glossy LED
Graphic Card Dual-Graphic -/AMD Radeon HD 7670M

All this for $550 dollars from TigerDirect. The closest comparable model was from HP for $750. I was really recommended to change the RAM speed so this was the first thing I did. Along with the laptop I bought a two stick pack of PC106-1333 8GB memory from PNY for $41 dollars only to have it be non-compatible (or I guess it could have been busted [but passed memory test]). After that I got it from crucial because of their Guaranteed-compatible promise and the speedup is noticeable.

I admit that I got the 5560G because of the graphic card to be able to play games, it was extremely appealing to me. The Notebookcheck tests on it seemed to me to be real good for a mobile graphic card. I was able to get into Dungeon and Dragons Online and the playability was good with the auto-detected medium-high graphic settings. Been thinking about SWTOR, hmm.

I’ll probably one day get a Solid state Drive down the road for it, the 5400 hard drive speed is definitely hard to miss at times. The one from crucial sounds pretty appealing, at $170 dollars though ughh, and I’m not sure I can live with 125GB.

The screen is nice and bright and seems to have good color replication though it does have a limited-gamut and viewing angle (a typical 1366 x 768 these days I’m told). It uses an LED which is nice; glossy, not so. Having it be so reflective worried me at first I was real surprised though when I turned it on how it made that shiny virtually indistinguishable.

Keyboard and touchpad feel good. The keyboard is full-size and key pushes offer an easy, uniform resistance. I really like the touchpad. The surface provides a nice bit of friction for feedback and the size fits really well. Wish manufacturers would get away from touchpad tapping on as default however (be nice if even there was a hardware way to turn it off).

The look and balance is nice as well (if you can’t tell the look from the photos). Doesn’t weigh too much and doesn’t feel off-kilter like other laptops I’ve experienced. The hinge is sturdy and pivots nicely.

Pluses and Minuses

  • + Price
  • + Graphic Card
  • - 5400rpm Hard Drive
  • - RAM Speed
  • - USB 2.0
  • ? USB port in front of DVD-writer

Linux

Site note first: I can’t believe I am saying it but I like Windows7. It’s well put together and has good help. Out of the box everything worked pretty well. What can I say though, I like hacking; plus I love open-source.

I’m not sure how I got so lucky buying this but after installing Ubuntu everything just worked. The reason I haven’t been using Arch exclusively anymore was because no matter what I tried I could not get suspend to work. Because I came to have limited time and needed my laptop to be able to suspend, I had to give up Arch. After I install Ubuntu 12.04 I hope to be a able to install Arch again and put Ubuntu’s Unity on top of it.

Final Thoughts

Gnome 3 and hence Ubuntu’s Unity are new and have problems with the Radeon drivers (both the proprietary catalyst driver and the open-source version) and desktop effects are laggy. I had thought to buy a laptop with an Nvidia graphic card because I had good experience with it before but after reading this post Linux users should probably think twice about buying laptops with optimus technology. So the only question I have left is how will this laptop do over time? For now at least, I’m very very happy.

Follow

Get every new post delivered to your Inbox.

Join 52 other followers