{ "color_scheme": "Packages/Color Scheme - Default/All Hallow's Eve.tmTheme", // linux //"color_scheme": "Packages/User/SublimeLinter/All Hallow's Eve (SL).tmTheme", // mac //"color_scheme": "Packages/Color Scheme - Default/All Hallow's Eve.tmTheme", // windoze "draw_indent_guides": false, "fold_buttons": false, "font_size": 11, "ignored_packages": [ "Vintage" ], "line_padding_bottom": 2, "line_padding_top": 2, "preview_on_click": false, "tab_size": 2, "translate_tabs_to_spaces": true, "detect_indentation": false }

#!/bin/bash while [ $# -gt 0 ]; do ffmpeg -i "$1" 2> tmp.txt while read -r first _ _ start _ end; do if [[ $first = Chapter ]]; then read # discard line with Metadata: read _ _ chapter ffmpeg -vsync 2 -i "$1" -ss "${start%?}" -to "$end" -vn -ar 44100 -ac 2 -ab 128 -f mp3 "$chapter.mp3" </dev/null fi done <tmp.txt rm tmp.txt shift done

Every day I see new Linux Kernel hackers fail at their first patch submission. I'm not an expert, but I've learned how the process works and most importantly I've learned how to avoid irritating Linux Kernel maintainers. The "maintainers" are the gate keepers to the Linux Kernel. If you piss them off you will never land any patches into the Linux Kernel. All Linux Kernel development takes place in the open and hundreds (thousands?) of Linux Kernel developers will see and possibly read your patch submissions. You will want to make every effort to submit the best possible patch you can. That's where I come in. If you follow my guide there's a better than average chance you will actually land your patch into the Linux Kernel. For a beginner I recommend working on the drivers/staging tree maintained by Greg Kroah-Hartman. Clone Greg KH's staging tree: > git clone git:// This will take a while. After that you need to checkou

I wrote a console version of Blackjack in Go: You can install it with these commands: go get go install

#!/usr/bin/env python3 import time import RPi.GPIO as GPIO GPIO.setmode( GPIO.BCM ) ENABLE = 1; DISABLE = 0 RED = 23; GREEN = 24; BLUE = 25 RGB = [ RED, GREEN, BLUE ] RGB2 = RGB[::-1]

#!/bin/sh PACKAGE=mypkg # set mode go test -coverprofile=coverage.out $PACKAGE go tool cover -func=coverage.out go tool cover -html=coverage.out # count mode go test -covermode=count -coverprofile=count.out $PACKAGE go tool cover -func=count.out go tool cover -html=count.out # more info:

func log(s ...interface{}) { f, err := os.OpenFile("info.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if err != nil { fmt.Printf("error opening log file: %v", err) os.Exit(1) } defer f.Close() log.SetOutput(f) ss := "" for _, p := range s { switch p.(type) { case bool: ss += fmt.Sprintf("%t ", p.(bool)) case int: ss += fmt.Sprintf("%d ", p.(int)) case float64: ss += fmt.Sprintf("%.2f ", p.(float64)) case string: ss += fmt.Sprintf("%s ", p.(string)) } } log.Println(ss) }

I don't play the lottery but I find random number generators and the Linux Kernel interesting so I wrote a simple Linux Kernel module that does a PowerballTM "quick pick".   You can download it from GitHub:

Ever want to know how to drop an argument (and value), --dir in this case, from a Bash script? Someone from my local LUG asked how to do it and this is what I came up with: Fun ;) #!/usr/bin/env bash args=("$@") myargs=() nextarg=-1 for ((i=0; i<$#; i++)) { if [ $nextarg == $i ]; then continue; fi case ${args[$i]} in --dir) nextarg=$((i+1)) ;; *) myargs+="${args[$i]} " esac } echo $myargs ./remove_dir.bash --dir foo --bar baz --bar baz
   Recent articles
ignore latin1 problem via psql
Convert one m4a file to many mp3s
How-to guide for beginner-level Linux Kernel patch submissions
Console Blackjack in Go
airplane (1) apache (1) apple (1) bash (2) bashrc (1) blackjack (1) callproof (1) console (1) data (1) debian (4) diff (1) django (2) enterprise (1) flying (1) freebsd (1) games (1) git (3) github (2) gmail (1) go (1) golang (1) go-lang (2) google (1) gourse (1) kernel (3) latin1 (1) linux (4) lottery (1) microsoft (1) module (1) mongodb (1) mp3s (1) mutt (1) patch (1) photos (1) postgresql (2) powerball (1) psql (1) python (2) raspberrypi (1) rc (1) sed (1) stack (1) sublime (1) testing (2) trace (1) ubuntu (2) utf8 (1) virus (1) waylon (1)

Copyright © 2016 · · All Rights Reserved