Dalla Rosa

Posts tagged linux

0 notes &

RPM Packages: Compilation flags

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 ;)

Filed under centos linux rpm tech server

1 note &

Fixing garbage text on terminal on Linux and Mac

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.

Filed under linux mac tech terminal vt100 memotoself

0 notes &

plist2ota - Generate OTA Manifests from plists

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 :)

Filed under plist ota manifest apple ios development tech linux macosx ruby perl

0 notes &

A new resolution: No more 32 bit software for me.

10 years ago, when I started dabbling with linux and later decided to make it my main environment, there were things from the Windows world that I couldn’t let go. Be it games, tools, services. I would spend hours and hours trying to get Wine to work and to run those things I could’nt live without. Until one day I realized that…I could live without them. Since that day I decided that if a tool, a service, a game wasn’t available for Linux it wouldn’t exist for me. 

10 years later, I see myself having the same problem but now regarding 32 bit applications. My notbook has a 64bit processor and I decided to fully use it with the latest 64bit version of Slackware. However, lately I’ve been spending just too much time messing around with my machine to get full multilib support so to get a few a applications working properly (namely Skype) that I ended up having more trouble with conflicting packages then with a proper solution to the original problem.

That led me to a new resolution: I won’t use anything that doesn’t have 64bit support. 

I totally don’t mind compiling packages, I totally don’t mind making patches for stuff. I don’t mind writing my own stuff. However, closed source software, like Skype, don’t really allow me to do any of those things.  Skype 4 came and we still don’t have a package that supports 64bit Linux. So no more skype for me. I’ll still be using it on Android and on Mac but at the same time I’ll be looking for a different solution, one that can offer me a 64bit linux compatible solution.

Filed under linux skype 64bit 32bit software tech

0 notes &

Maximizing and restoring panes in tmux

Recently I gave up on screen for tmux. From the tmux homepage:

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

Tmux is screen on steroids. You can customize just everything, from starting applications automatically to the background color to the key bindings. The multi-pane temrinal thing is pretty cool but sometimes you just wanna focus and work in just one fullscreen pane while keeping the ability to switch back to the multi-pane mode.

Originally there are no bindings for (or a simple command) to maximize and restore the size of a pane.

After some googling, I found a perfect solution for the problem and I decided to share it with everyone:

unbind + 
bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom 
unbind - 
bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoom

These will bind the “+” and “-” for maximizing and restoring, respectively. 

My own tmux.conf can be found on github.

(Source: superuser.com)

Filed under tmux terminal multiplexer linux macosx maximize restore