Thursday, September 27, 2012

nvPy - mlty-platform notacional velocity

Notacional velocity is a very nice note taking application for mac, now there is also nvPy, according to the author:
nvpy is a simplenote-syncing note-taking tool inspired by Notational Velocity (and a little bit by nvALT too) on OSX and ResophNotes on Windows. It is significantly uglier, but it is cross-platform. Yes, you heard right, you can run this on Linux (tested), Windows (tested) and OS X (lightly tested).

The url is https://github.com/cpbotha/nvpy

Friday, July 06, 2012

Here are some useful shortcut keys for the open/save dialog window of macos X:
Spacebar – View the selected item in Quick Look
Command+D – Selects Desktop as the destination
Command+Shift+H – Sets the Home directory as the destination
Command+Shift+A – Sets Applications directory as the destination
Command+Shift+. – Toggle invisible items
Command+Shift+G – Bring up Go To Folder window
Tab – Tab key auto-completes paths and file names from the aforementioned Go To window
Command+R – Open the selected item in the Finder
Command+F – Move the cursor to the Find field
Command+. – Close the Open/Save dialog window

Wednesday, June 13, 2012

Monday, May 07, 2012

I was getting annoying messages in the console tty1-8:
[34895.467445] jme 0000:02:00.5: eth0: UDP Checksum error
[34896.613044] jme 0000:02:00.5: eth0: UDP Checksum error
[34896.620748] jme 0000:02:00.5: eth0: UDP Checksum error
[34896.727510] jme 0000:02:00.5: eth0: UDP Checksum error
[34896.933031] jme 0000:02:00.5: eth0: UDP Checksum error
I tried to fix it playing with the system log /etc/rsyslog.d/50-default.conf, but that was not it, I could get a copy of the stream to a file, but not prevent the stream from flooding my screen. The solution was the kernel printk definition. running teh line sudo sysctl kernel.printk="3 4 1 7" it stopped the messages, looking around this variable is defined in /etc/sysctl.conf, so I uncommented the line
# Uncomment the following to stop low-level messages on console
kernel.printk = 3 4 1 3
This solved my problem permanently. NEW SOLUTION from http://theamdara.blogspot.fr/2014/01/linux-jme-micron-udp-checksum-error.html
ethtool -K eth0 rx off

Friday, April 13, 2012

MacOS X Dicionary shortcut

To access the inbuilt MacOS Dictionary you can select a word and press ctrl-cmd-d, you will get the dictionary entry for the selected word. This only works in the more integrated programs: Safari, iWork, etc..

Wednesday, April 04, 2012

Tuesday, April 03, 2012

split2flac: slip a audio file

split2flac splits one big APE/FLAC/WV/WAV audio image (or a collection of such files, recursively) with CUE sheet into FLAC/M4A/MP3/OGG_VORBIS/WAV tracks with tagging, renaming, charset conversion of cue sheet, album cover images. It also uses configuration file, so no need to pass a lot of arguments every time, only an input file.
https://github.com/ftrvxmtrx/split2flac
from onethingwell

Thursday, March 29, 2012

emacs: Cycle windows backward

To cycle windows in emacs you can use the shortcut c-x o that executes the command other-window. Now to cycle windows in the reverse order you need to execute the command other-window with argument -1 (other-window accepts integer as argument, being the number of windows to jump). So I added this code to my .ecmas file:
;; cycle windows in reverse order
(defun prev-window ()
  (interactive)
  (other-window -1)
)
(global-set-key (kbd "C-x p") 'prev-window)
This will create the command prev-window and assign the shortcut C-x p to this function. Note: C-x p is by default assigned to narrow-to-page, a function I never used... This Idea I found it originally in Quora.com

Resize windows in emacs

To easily resize windows in emacs I added the following key shortcuts:
;; * \author Pedro Parracho   
;; Resizing windows using alt-arrow
 (global-set-key (kbd "\033[1;9D") 'shrink-window-horizontally) ;;alt-left: code ^[[1;9D                                                    
 (global-set-key (kbd "\033[1;9C") 'enlarge-window-horizontally) ;; alt-right: code ^[[1;9C                                                 
 (global-set-key (kbd "\033[1;9A") 'shrink-window) ;; alt-up: code ^[[1;9A                                                                  
 (global-set-key (kbd "\033[1;9B") 'enlarge-window) ;; alt-down: code ^[[1;9B                                                               
Now alt-arrow will change the window size by a step.

Monday, March 26, 2012

GNU screen renumber windows

When working a long time with a screen session, you might get holes in the screen numbering, to change the number of the current windows do ctrl-a : number <number>
There is a script that will renumber all the windows in a session, you can find it in http://brainscraps.wikia.com/wiki/Renumbering_GNU_Screen_Windows

Swap two characters in emacs

To transpose 2 characters the emacs command is transpose-chars and the shortcut is C-t.
For words the command is transpose-words and the shortcut is M-t.

Thursday, March 22, 2012

Go to next unread message in Mail via keyboard

A long standing annoyance in Mail is that there is no keyboard shortcut to skip to the next message. I found in hints.macworld.com a apple script that will jump to the next unread mail on ctr-n.
I changed the script to jump to the last item and not the first, as I like to read my messages by chronological order.
try
 tell application "Mail"
  activate
  tell the front message viewer
   set unreadMessages to (the messages whose ¬
    read status is false) as list
   if (count of unreadMessages) is not 0 then
    set selected messages to {the last item of unreadMessages}
   else
    beep
   end if
  end tell
 end tell
on error error_message
 beep
 display dialog "Error looking for next unread message: " & ¬
  return & return & error_message buttons {"OK"} default button 1
end try
To have this script activated, instead of copying it to the mail script folder as suggested in the article, I created a new service with "no input" in "Mail.app" that will run the apple script on the top. Saved the service, and added the shortcut ctrl-n in the keyboard settings.

Wednesday, March 21, 2012

SvnX hurdles

I was having 1 problem common to svn and svnx. The problem was the message: "Killed by signal 15."

I found out that this was something that happens for svn > 1.6.6.

The solution according to old.nabble.com is to add the option -p to the ssh command in your svn configuration file ~/.subversion/config

The other problems was /usr/bin/xauth: error in locking authority file .Xauthority this got solved by adding the option -x

My line in ~/.subversion/config is now:
ssh = $SVN_SSH ssh -o ControlMaster=no -q -x

Tuesday, March 06, 2012

regexp and emacs

You can test your regular expression in emacs by activating the mode regexp-builder.

 Note: the regexp-builder by default will use the lisp syntax, to use the one that emacs use in replace-regexp command you need to change the syntax mode using the command reb-change-syntax, use the value string.

 Another nice way to test your regexp is in this website http://gskinner.com/RegExr/

Monday, March 05, 2012

Great clipboard manager

FlyCut seems to be a very nice clipboard manager, based in the Jumpcut. You can find it in the App store, or bettr yet in the git: https://github.com/TermiT/flycut

Thursday, February 23, 2012

Add your kerberos password to keychain

The magic command is:

security add-generic-password -a "myusername" -l "label to define entry" -s "realm" -w "mypassword" -c "aapl" -T "/usr/bin/kinit"

Thursday, February 09, 2012

Create shortcut by click and drag in Mac OS X

To create a shortcut in Mac Os X you can right-click (click+ctrl) and chose the option "Make alias", and then move this alias where you want it.

Or you can drag the target of the alias and also press Command(apple button)+option. The alias will be created where you drop the file.

Friday, January 06, 2012

Controling airport from command line

I wrote two small scripts to control the power status of the mac airport.
  1. Power cycle the airport
  2. 
    #/bin/bash
    # This script does a power cycle of the airport
    # Pedro Parracho <pedro.parracho@gmail.com>
    
    /usr/sbin/networksetup -setairportpower airport OFF
    /usr/sbin/networksetup -setairportpower airport ON
    
    
     
  3. Toggle the power status
  4. 
    #/bin/bash
    # This script toogles the power status of the airport 
    # Pedro Parracho <pedro.parracho@gmail.com>
    
    airportPower=$(/usr/sbin/networksetup -getairportpower airport| cut -d' ' -f4 | tr '[:lower:]' '[:upper:]')
    
    if [ $airportPower = "ON" ]
    then
        echo airport is ON, turning it OFF
        /usr/sbin/networksetup -setairportpower airport OFF
    else
        echo airport is OFF, turning it ON
        /usr/sbin/networksetup -setairportpower airport ON
    fi