The GNU of Life, the Universe and Everything

March 8, 2012

Syntax hightlight theme for Ruby/Rails/Haml in Aptana

Filed under: Aptana, Ruby — Tags: , , , , , , , , , — Pedro Carvalho @ 12:21 am

I have a thing for code and colours. Let it be lolcode, lpsolve syntax for whatever the editor i’m using at the time, i have to tweak it.

This time i’m learning Ruby/Rails/Haml and whatnot. My favorite editor for WebDev has been Aptana with the Clouds theme, (a bit edited already) but it didn’t support ruby. So here it is “Clouds of Ruby”.

What does Clouds of Ruby look like?

Clouds of Ruby :: Ruby/Rails

Ruby/Rails Theme for Aptana

Clouds of Ruby :: HAML

HAML Theme for Aptana

Where to get Clouds of Ruby?

download Clouds of Ruby Theme. I recommend the Anonymous Pro font to go well with it.

To use, go to Preferences->Aptana Studio->Themes->Import. Change at will and have fun coding!

December 17, 2011

Lpsolve Syntax Highlight for Geany IDE

Filed under: Geany — Tags: , , , , , , , — Pedro Carvalho @ 12:50 am

Add Lp Solve extension

Lp solve files Syntax highlight for Geany

An example of Lp solve files Syntax highlight in Geany

First, we need to add the extension file, so geany knows what file it can associate to lp solve files.

Either go to:  Tools -> Configuration Files -> filetype_extensions.conf

or:  edit directly the file in

Linux: ~/.config/geany/filetype_extensions.conf

Windows 7 :  c:\Users\username\AppData\Roaming\geany\filetype_extensions.conf

and add a new line with

Lpsolve=*.lp;

Download Lp Solve syntax highlight file

Next, download this syntax highlight file:  filetypes.Lpsolve.conf

and place it in ~/.config/geany/filedefs/ (Linux)

or c:\Users\username\AppData\Roaming\geany\filedefs\ (Windows 7)

More information on syntax highlight

Note:  if not bothered to download this file, you can add the extension to any existing filetypes, for example:

C=*.c;*.h;*.lp;

Many thanks to geanycolourscheme.xtreemhost.com editor.

February 2, 2010

making gentoo portage more quiet without showing preverved libs and installed masked packages

Filed under: gentoo — Tags: , , , , , — Pedro Carvalho @ 9:00 pm

Well, it was one of those days drifting from trying to do one thing, and ending fixing the core system.

emerge been having alot of output lately, and its extra verbosity was driving me mad.

First, showing the preserved-libs takes alot of time.
Second, now i have always have to scroll up to check if the emerge succeed , for emerge warnings bout the packages and whatnot.

The other annoying thing is it warning me that are installed packages that are currently masked for one reason or the other by the maintainers.

… and then proceed to list them all, completely unrelated to the package being emerged.

so that was my itch. i’ve scratched not sure if i tore up anything vital :D

it was built against portage-2.2_r61
(note: the following code might be broken due to wordpress weirdness)

--- portage-2.2_rc61_new/pym/_emerge/main.py 2010-02-02 07:18:02.000000000 +0000
+++ portage-2.2_rc61_mod/pym/_emerge/main.py 2010-02-02 05:15:09.000000000 +0000
@@ -73,6 +73,7 @@ options=[
"--unordered-display",
"--update",
"--verbose",
+"--show-preserved",
]


shortmapping={
@@ -214,13 +215,12 @@ def display_preserved_libs(vardbapi, myo
vardbapi.plib_registry.pruneNonExisting()


if vardbapi.plib_registry.hasEntries():
- if "--quiet" in myopts:
+ if "--show-preserved" in myopts:
print()
- print(colorize("WARN", "!!!") + " existing preserved libs found")
- return
+ print(colorize("WARN", "!!!") + " existing preserved libs:")
else:
print()
- print(colorize("WARN", "!!!") + " existing preserved libs:")
+ print(colorize("WARN", "!!!") + " existing preserved libs found")
return


plibdata = vardbapi.plib_registry.getPreservedLibs()
--- portage-2.2_rc61_new/pym/_emerge/depgraph.py 2010-02-02 07:18:02.000000000 +0000
+++ portage-2.2_rc61_mod/pym/_emerge/depgraph.py 2010-02-02 05:15:14.000000000 +0000
@@ -4908,12 +4908,12 @@ class depgraph(object):
pkg.cpv, pkg.metadata, mreasons))
if masked_packages:
writemsg("\n" + colorize("BAD", "!!!") + \
- " The following installed packages are masked:\n",
+ " There are some installed packages currently masked!\n",
noiselevel=-1)


- show_masked_packages(masked_packages)
- show_mask_docs()
- writemsg("\n", noiselevel=-1)
+# show_masked_packages(masked_packages)
+# show_mask_docs()
+# writemsg("\n", noiselevel=-1)


def saveNomergeFavorites(self):


i hope it helps.

note that there’s a new flag “–show-preserved” that.. well.. makes it show the preserved libs.
After that, lafilefixer will try to fix any semi-broken .la files, deleted or hanging around.

January 3, 2010

how to fix firefox hanging every few seconds

Filed under: linux — Tags: , , , , , , — Pedro Carvalho @ 5:25 am

Every x seconds, my firefox (built from sources) hangs for a few seconds (but the other applications keep running smothly).

Seems that my firefox (i didn’t tried using the binary) isn’t very keen on multithreading.
By default it has:

$ taskset -c -p firefoxpid
pid 29964's current affinity list: 0,1

To find firefox’s pid do:

$ ps -eo pid,comm | grep firefox
29964 firefox

So, firefoxpid is 29964, only in this case (pid varies). I needed to do this:

taskset -c -p 0 29964

with -c 0 (<– that’s a zero) the affinity mask is set to 1, so firefox only is allowed to use one cpu.
Take note of the parameters ordering: first the flags ( -c -p ) them the values ( <affinity list> <pid> )

the cpu id:
$ taskset -c -p firefoxpid
pid 29964's current affinity list: 0

the number of cpu’s allowed:
$ taskset -p firefoxpid
pid 29964's current affinity mask: 1

If firefox is to start from the beginning restricted,  it can be launched like:

taskset -c 0 firefox

That should lessen the hangings. In my case, javascript still hanged a bit.

December 15, 2007

How to prevent emacs from showing the splash screen

Filed under: emacs — Tags: , , — Pedro Carvalho @ 7:39 am

Emacs‘ splash screen is enable by default, even if it’s started with a argument, like opening a file. So the solution was always in the splash screen but you’ll find out how to remove the splash screen using the essencial dot emacs file (more…)

November 15, 2007

How to create and remove a soft link, symlink or symbolic link

Filed under: console, linux — Tags: , , , , , , , — Pedro Carvalho @ 10:42 pm

A soft link, or more common, a symlink, is link a shortcut to the targeted file or directory. So when is removed the original target stays present. This is the opposite of a hard link which is a reference to the target and so, if the hard link is removed, so is the target.

A symlink can be created like: (more…)

June 23, 2007

Nano – Shortcuts, syntax highlight and nanorc config file – pt1

Filed under: nano — Tags: , , , , — Pedro Carvalho @ 8:02 pm

I have been using nano as my favorite console editor (i use emacs/kate for the rest) for some time now. It’s simplicity, the speed and usefulness of it made it what it is. But recently, i’ve been trying to find out more features that i might been missing. One of those were the shortcuts. The other was syntax highlighting! Meanwhile, the things i discovered!
(more…)

Nano – Shortcuts, syntax highlight and .nanorc config file – pt2

Filed under: nano — Tags: , , , , — Pedro Carvalho @ 7:36 pm

And now, let’s look at the .nanorc file.

Here, i’ll go through the .nanorc config file, try to explain parts of it and set the syntax highlight on.
See the first part for shortcuts .
(more…)

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.