Posts tagged tech
Posts tagged tech
0 notes &
Slackware on ASUS Zenbook Prime UX31A.
0 notes &
Since October last year I took over the server management tasks in my project. Unfortunately, those machines are loaded not with Debian but with Scientific Linux (Why SL is one of the great mysteries of universe).
One of these days I needed to know which were the compilation flags of a package.
TL;DR:
rpm -q --queryformat="%{NAME}: %{OPTFLAGS}\n" PACKAGE_NAME
Long Version:
-q or —query is the flag for querying information about a package.
—queryformat is quite obvious but here it is: use this flag to set the the output format of the query result.
A bit more on —queryformat:
According to the docs:
Query formats are modifed versions of the standard printf(3) formatting.
Ok, how can I get a list of the information I can output?
Again, from the docs:
rpm will print a list of all of the tags it knows about when it is invoked with the —querytags argument.
Kinda weird to be writing about RPM based distributions but oh well, at least I’m not managing Windows servers ;)
1 note &
This is the second time I break the screen of a notebook.
First time was with this this Asus Eee PC 1000HE I had for a 1 year and a half. The little boy was on beside my bed and so it had an encounter with my foot, long enough just to crack the LCD screen. The second time was a few weeks ago. I was doing some work on the bed before sleeping but I actually fell asleep. The notebook just fell. Here I am again with a broken LCD screen.
The first time I really had no idea of where to buy a new screen, so I just went around the web looking for some japanese site that seemed reliable enough and that was selling notebook LCD screens. The search took a few days but I ended finding 液晶プロ(Ekishou Pro - “LCD Pro”).
They specialize on replacement LCD screens for notebooks and have a pretty nice line up, covering most brands like Asus, Dell and even Apple.
The looks of the website don’t really help but my first buying went really smooth. The screen for my notebook was listed as in “contact us” so I sent them an email which was quickly replied by their staff with a link to the an available screen, compatible with my model. Payment can be done through credit card or bank transfer.
The LCD arrived in a few days and worked all pretty well.
So, this time when I got yet another screen broken it was a no brainer. Just went to Ekishou Pro and looked up my model (Dell Inspiron 1122 - or M102z) and quickly found it around the Dell, 11.6 inches category.
Can’t wait for it to arrive soon and get my machine back!
0 notes &
A simple way for adding attribute accessors to a class dynamically:
class MyClass
def add_attr(name, value)
self.class.send(:attr_accessor, name)
instance_variable_set("@#{name}", value)
end
end
1 note &
Sometimes you just happen to cat a binary file and it just messes up your terminal output and all can see and type is garbage.
Normally here you’d just give up and reopen your terminal but here’s another solution: Just type the command below:
echo -e \\033c
All you’re doing is sending an ESC(033 is the octal version of the ASCII control key “ESC”) + a letter “c” to the console, which is a VT100 command to reset the terminal to its default settings. If you’re curious about other VT100 commands, take a look at this page. You can send them all using
echo -e
followed by the the codes in ASCII. This works in any VT100 compatible terminal which means that you’re safe to use it on your Linux or Mac machine.
Edit: As some people said in the comments and at G+, you can just use the “reset” command, which is actually doing the above and some more.
To read more about the reset command, check the man pages here.
1 note &
I’m trying to finish the Go Tour and one of the exercises was to write a Fibonnaci closure, that is, a closure that generates the Fibonnaci sequence.
It was a cool exercise to learn on closure works in Go, so to remind myself of this later, I’ll share it here:
1 note &
Playing around with math and images at ”a Tour of Go”
1 note &
0 notes &
A friend of mine was in need of a script to automatically generate the OTA Manifests needed to distribute iOS apps internally through the iOS Developer Enterprise License.
So I wrote a little Ruby script that uses the plist gem for creating a Ruby Array from the plists information. One limitation I found in the plist gem is that it can’t parse binary plists. Right now I’m working on implementing that in Ruby and see if I can get it added to the gem but, for now, I just added to the package this perl script I found, indicated by this page.
If your plist is a binary one, just convert the plist to XML using the plutil.pl script and then using plist2ota.rb to generate your OTA Manifest.
The link is here: https://github.com/dallarosa/plist2ota
Requests, issues and sugestions, please use Github’s issues page :)
0 notes &
One of the best plugins I’ve found for vim is CommandT. It lets you open files in a very speedy and intuitive way, making it very simple to search files and open them in tabs, splits or vertical splits. Or so it should be. On OS X, opening a file on a new split doesn’t really work. You should be able to do it using the Ctrl-S shorcut but it just doesn’t work.
Today I decided to go after this problem. Looking around the net, I found an article explaining the reason:
I found a related tip indicating that by default, Terminal.app reserves Ctrl-S for old-fashioned XON/XOFF flow control.
Ok, so the Terminal app doesn’t allow us to use Ctrl-S because it’s a reserved shortcut. What to do?
Simple, just add the lines below in your ~/.bashrc
stty -ixon -ixoff
It will disable the above behavior and free Ctrl-S and Ctrl-Q for use in terminal apps!
Reminder: Just adding that to your bashrc won’t change the settings in the currently open terminal windows. Type the command above on the terminal so you can have the benefits right now, or reopen all your sessions.