Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
RAMDISK_IMAGE=$1
RAMDISK_MOUNT_IMAGE="/mnt/initrd"
BUSYBOX_IMAGE='/home/rsivagur/oss/linux_lab/busybox/busybox'
# Housekeeping...
rm -f $RAMDISK_IMAGE
@ageekymonk
ageekymonk / cscope-kernel.sh
Last active December 23, 2015 18:59
Select kernel Source for cscope, a sample find command
KERNEL_ROOT = ~/linux/kernel
find $KERNEL_ROOT \
-path "$KERNEL_ROOT/arch/*" ! -path "$KERNEL_ROOT/arch/x86*" -prune -o \
-path "$KERNEL_ROOT/tmp*" -prune -o \
-path "$KERNEL_ROOT/Documentation*" -prune -o \
-path "$KERNEL_ROOT/scripts*" -prune -o \
-path "$KERNEL_ROOT/drivers*" -prune -o \
-name "*.[chxsS]" -print > $KERNEL_ROOT/cscope.files
@ageekymonk
ageekymonk / templates.xml
Created June 15, 2013 13:53
Eclipse Templates
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="true" context="org.eclipse.cdt.ui.text.templates.c" deleted="false" description="Function Header" enabled="true" name="comment_function">/**
* @brief ${brief}
*
* ${detail}
*
* @param [${input}] ${input_desc}
*
* @retval [${output}] ${output_desc}
*
* Example Usage:
@ageekymonk
ageekymonk / .bash_aliases
Last active December 18, 2015 09:39
My bashrc
alias ..='cd ..'
alias ...='cd ../..'
alias pfind='ps aux | grep '
@ageekymonk
ageekymonk / rhythmbox.sh
Created February 28, 2013 05:21
Controlling Rhythmbox from console
alias pauseplay='dbus-send --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.gnome.Rhythmbox.Player.playPause boolean:true'
alias next='dbus-send --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.gnome.Rhythmbox.Player.next'
alias prev='dbus-send --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.gnome.Rhythmbox.Player.previous'
alias incvolume='dbus-send --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.gnome.Rhythmbox.Player.setVolumeRelative double:.1'
alias decvolume='dbus-send --dest=org.gnome.Rhythmbox /org/gnome/Rhythmbox/Player org.gnome.Rhythmbox.Player.setVolumeRelative double:-.1'
@ageekymonk
ageekymonk / banshee.sh
Last active December 14, 2015 07:59
Controlling Banshee Music player from console
alias pauseplay='dbus-send --type=method_call --dest=org.bansheeproject.Banshee /org/bansheeproject/Banshee/PlayerEngine org.bansheeproject.Banshee.PlayerEngine.TogglePlaying'
alias next='dbus-send --type=method_call --dest=org.bansheeproject.Banshee /org/bansheeproject/Banshee/PlaybackController org.bansheeproject.Banshee.PlaybackController.Next boolean:false'
alias prev='dbus-send --type=method_call --dest=org.bansheeproject.Banshee /org/bansheeproject/Banshee/PlaybackController org.bansheeproject.Banshee.PlaybackController.Previous boolean:false'
@ageekymonk
ageekymonk / scrapeBooks.rb
Created February 26, 2013 06:34
Download Books and Authors list from goodread.com site
require 'rubygems'
require 'mechanize'
require 'nokogiri'
@filename = "bookslist.txt"
@book_list = {}
@a = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
@ageekymonk
ageekymonk / reverese_word.rb
Created February 19, 2012 03:21
Ruby snippets
def reverse_word str
str.reverse.split(" ").map { |n| n.reverse }.join(" ")
end
reverse_word "This is really awesome"
@ageekymonk
ageekymonk / cedet_config.emacs
Created February 10, 2012 09:13
Emacs file for cedet + ecb
;;============EDIT THESE LINES with your path==========
(add-to-list 'load-path "<path_to_cedet-1.0.1>")
(load-file "<path_to_cedet-1.0.1>/common/cedet.el")
(add-to-list 'load-path "<path_to_ecb_folder>")
(require 'ecb)
(semantic-load-enable-excessive-code-helpers)
(require 'semantic-ia)
@ageekymonk
ageekymonk / highlight.el
Created February 8, 2012 06:42
Highlight the current word in buffer. Similar to F8 highlight in Source Insight.
;; Shift F8 will highlight all the words that match underlying word in the buffer
(defun is-word-highlighted ()
(interactive)
(let ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face))))
(if (facep face) (if (face-equal face "hi-yellow") t nil) nil)))
(defun toggle-highlight-word ()
(interactive)
(setq sym (concat "\\<" (current-word) "\\>"))