First figure out which theme you are using. List installed themes via:
% pelican-themes -l
simple
notmyidea
pelicanconf.py does not …
read moreFirst figure out which theme you are using. List installed themes via:
% pelican-themes -l
simple
notmyidea
pelicanconf.py does not …
read moreI think it improves website usability when they are navigatable via the URL.
For example when viewing Posts under the …
read more^ Matches the beginning of a line
$ Matches the end of the line
. Matches any character …
Node Red vs Home Assistant
Which is better* ?
*better: CPU/RAM efficient, easier to learn and or offer better support …
read moreWith Proxmox installed time to setup Plex in a container, and migrate from Synology NAS.
I am following these guides …
read moreTo improve the Plex transcoding options and off load the computation from the NAS, the plan is purchase a BeeLink …
read moreCat 8 Wiring, comes in 2 variants T-568A and T-568B.
Cat8 replaces the need for crimping tools with field termination …
read moreWhen a Synology NAS creates a VPN connection it overides the default gateway, except for devices listed as contained within …
read moreWhen TeX/LaTeX is fully justifying text there are times when it could do better but it does not know …
read moreparbox
is a LaTeX command used to place a box around text.
Remeber that optional arguments are in [] (Square brackets …
read moreLaTeX macros can be used as simple text replacments for example:
\documentclass{article}
\newcommand{\LUG}{LEGO User Group}
\begin{document …
WYSIWYG editor for LaTeX lyx, and a manager for Bibliography JabRef.
Lyx Tutorial: Lyx mac Guide
JabRef Tutorial: Getting Started …
read moreCreating/Setup a pyhton virtual enviroment called 'venv'
python3 -m venv venv
Load the virtual env called venv
source venv …
Convolution in Python, for merging filter responses, creating pascals triangle ...
import numpy as np
a= np.array([1,1])
b …
Perforce can temporarily checkins of changes that you might want to share with others before fully commiting them to the …
read moreUsing python script to merge pdfs together.
Install package
pip install pypdf
Script:
from pypdf import PdfWriter
pdfs = ['file1.pdf …
On the journey towards publish static site generator blog posts from iPadOS, my next step after installing stash on pythonista …
read moreInstalling stash on pythonista
read morePython example for reading data from a csv file.
import csv
with open(data.csv', newline='') as csvfile:
spamreader = csv …
Create and plot a sinewave in python
read moreApples default directory structure is :
/Users/username
├── Desktop
├── Documents
├── Downloads
├── Library # Hidden by default
├── Movies
├── Music
├── Pictures
├── Public
My current …
read moreAfter accidentally scrolling back a page when browsing the web in chrome too many times. Figured out how to disable …
read moreWhen .
just will not do (repeats last action) because you need to capture a movement as well, macros are quick …
1 2 3 4 5 6 7 8 |
|
To prepend to to filenames
cd to_folder
ls | xargs -I {} mv {} addthis-{}
or target jpgs
cd to_folder
ls *.jpg | xargs …
Just realised there is a difference between word and WORD in Vim.
WORD is non-blank delimited by whitespace. word is …
read moreI just discovered the xkill
command, when a window has crashed you
can call xkill and get a skull and …
error: storage class specified for parameter
There is probably a missing semicolon ;
in a header file! Just written my first …
To redirect stdout and stderr in bash we use:
./ShellFile.sh &> test.log
However in tcsh that results in:
Invalid …
As I use the code blocks for ingredient lists on my recipe pages I wanted to have a different style …
read moreRuby methods can set default values for optional arguments:
def commit(path=Dir.pwd)
To take an optional number of …
read moreWith a command line Ruby application using Thor for the option parsing I want to be able to run:
$ thor_app …
When creating my blog I have been inconsistent with the tag command line
, Command line
and
Command Line
the case …
Enter copy mode
ctrl-a [
Use cursors of vim motions to move to relevant area.
Space to start selection, space again …
read moreSince upgrading to Mavericks I get a sound whenever I get mail. I find this very annoying so first port …
read moregit tag -a 0.0.1 -m "Tag comment"
git push --tags
Note: The use of major.minor.patch Semantic …
read moreRemoval of substring:
string="test string"
echo $string
remove="test"
short_string=${string#$remove}
echo short_string
Note that inside the ${}
string …
In your sources
branch, which is the main branch for writing creating posts, create a CNAME
file in the sources …
I use gitx
graphical tool on OS X to find the SHAs for commits. Revert back …
Creating new posts in Octopress is rake new_post["Edit Posts"]
which outputs the created filename.
Posts are prefixed with date …
read moreSometime ago I enabled focus tracking the mouse on Gnome. It took a while to find how to disable it …
read moreBased on post_filters by imathis.
First Move the original method out the way with alias_method
then create a new method …
Received the following errors when doing brew update
on mountain lion:
error: The following untracked working tree files would be …
$ git submodule update
fatal: Needed a single revision
Unable to find current revision in submodule path 'vim/bundle/systemverilog'
To …
read moreI use to use svn revert
to roll back local modification and get back to the state I was in …
rtorrent moving torrents upon completion:
# Torrents go in ~/Torrents
# Incomplete Downloads in ~/Incomplete
# Upon Completion Data is moved to ~/Seeding …
This is not a foolproof method, as vim colorschemes are just vim commands but by default they set:
let g …
Here are some aliased commands which stop line wrapping on really long lines, making the output much more readable:
# Stop …
Deciding to see if I could make my vim status line a bit more practical for myself. I decided to …
read moreGood programming practice is to use spaces to indent code rather than tabs. Due to tabs often being rendered differently …
read moresetenv allows sub shells to inherit the value.
set x = "twenty"
echo $x
> twenty
## New Shell
csh
echo $x …
cat /etc/redhat-release
Returns some thing like:
Red Hat Enterprise Linux Client release 5.7 (Tikanga)
Find Kernel version using …
read moreIn the UK you can now get regional weather alerts from the Met Office.
Unfortunately it does not break it …
read moreTo check if an environment variable exists in .mycshrc or shell scripts
if ($?TERM) then
echo "TERM is $TERM"
endif …
In ruby Dir.entries takes a path and returns a list of its contents. However it does not deal with …
read moreI have decided to clean up my vim colorschemes. I have been using ir_black for sometime but it does not …
read moreOn the continuous search for a decent ADSL, Router and Wireless access point. I have tried many (unscientifically). Finding that …
read moreStackoverflow have supported markdown for a while. The syntax for showing an image is :
![Holes in Leaf 1][1]
[1 …
I was wanting to use Dir.glob to get a file list and wanted to do Dir.glob( path + '*')
but …
To add static about page to octopress blog, assuming that octopress has been already setup:
Create the page from the …
read moreAfter struggling to get the rake task for octopress to deploy I decided to fall back to the command line …
read moreStill unresolved
The Jetway ADPE4S uses a Marvell 88SE6145 chip which a number of users have had trouble getting to …
read moresudo lshw -class disk -class storage -short
Outputs :
H/W path Device Class Description
=====================================================
/0/100/1c.3/0 …
BT broadband has BT Web Address Help enabled by default. This allows then to redirect you to another site if …
read moreNormally this would just end up on my link blog, but thought it was worthy of a proper mention.
read moreBitTorrent Sync although still in Beta offers a App and protocol for DropBox like file syncing. As it is an …
read moreISO 8601, to me looks a lot like reversed British format which has been my standard for including in file …
read moreConfigurable order of numbers:
x+y = y+x
xy = yx
Order that multiplication is applied :
(x+y)+z …
To enable code folding in Vim type (from normal mode):
:set foldmethod=marker
Or add this to your .vimrc
set …
How to get method which handles a single string input or an array of strings?
* turns single strings into …
read moreAfter running a brew upgrade
rtorrent was plagued with segmentation faults. Which look something like :
Caught Segmentation fault, dumping stack …
To capture the screen on OS X :
⇧⌘4 : Selected area to capture.
⇧⌘4-space : Capture a window.
These are defined in …
read moreTake an array of arrays and format it for displaying to the terminal or outputting to a text file …
read moreGiven a flat hierarchy of data comprising level and a label, aim to nest the lower level of objects in …
read moreAfter getting Safari 6 it seems that YouTube is no longer letting my watch video as html5 video formats and …
read moreFor this example we will have a data file with two columns of data labelled A and B. For example …
read moreFor code reuse within I have found Subversion externals really nice to work with. Instead of copy and pasting code …
read moreThis is based on a guide to adding retina support to websites.
To add a tiled (repeating) background cretae 2 …
read moreIf entering Mission Control (ctrl-up) is taking to long you can speed up the animation entering the following in the …
read moreA the time of writing Google exchange syncing only works on mobile devices, which is slightly annoying but mail, contacts …
read moreTHIS NO LONGER WORKS, IF IT EVER DID :(
When you add a link to safari, it replaces the link to …
read moreIn gvim and mvim incorrect spellings are highlighted with a squiggly underscore ala MS Word. vim in a terminal (xterm …
read moreFor ssh and ping to local machines with out the .local extension I added them to my /ets/hosts file …
read moreIf you use the ⌘I shortcut in finder with a file selected you get a 'Get Info' window. If you …
read morectrl-6
For the example we will create 3 new temp files and then open them in vim.
touch vim_test1 …
From OS X Lion the Users Library folder has been hidden. To find it make Finder the active application, that …
read moreThere is currently a preview (Beta) of [Little Snitch 3][littelsnitch3]. If you have not come across Little …
read moreFollowing on from Macbook Pro Setup, Now it is time to install some of the command line tools.
I have …
read moreSome info on what has changed in Xcode 4.3. Latest is 4.4 but a lot changed in 4 …
read moreMacBook Pro with Lion arrives, before installing any other software apply for the Up-to-Date Programme for free a mountain lion …
read more/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
To Reset it back to this value run (from /Applications/Utilities …
read more/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
To Reset it back to this value run …
read moreI have specifically been trying to find out how to transfer my full GB Memory Map OS 1:50K 2012 …
read moreOne of the limitations of mountain lion is that they are only going to support 64 bit Kernel extensions, the …
read moreAfter deciding to try out epub on the kindle, as I noticed people are listing epub as an apple format …
read moreThe subscribe button on the iPad youtube app is quite well hidden.
View a video from the channel you are …
read moreGot the steam punk Gelaskins case yesterday, they can be a fiddle to fit but incredibly thin and adds grippines …
read moreIn iOS 5 If you have iTunes Match enabled ie to download your songs from the iCloud while on the …
read moreAround up of nice looking ipad docks / cradles
From Just Mobile
UpStand | Encore Desktop | Slide |
---|---|---|
[ ][ encore] | [ ][ slide ] | |
£32.50 | £48 … |
While using a pool laptop from work and trying to connect to my home wifi I am prompted for my …
read moreTo reduce an array of Booleans to a single Boolean using enumerables reduce method:
[true, true, true].reduce( :| ) ## OR
=> true …
In ruby you can catch StandardErrors using begin rescue end
begin
#Some thing which might fails
rescue
$stderr.puts $!
end …
There was an interesting post on hacker news recently, safeshepherd suddenly fell off the google for their own name. The …
read moreA recent article by sef about how to judge an engineering companies respect engineers and the strength of the engineering …
read moreThree now have tethering available for the iPad 3, which can be read in the comments by moderators on the …
read moreWhen working behind a restrictive firewall, which limits ssh connections you may be running into some of the following errors …
read moreI started off following the ubuntu guide for installing a new drive, which uses fdsik to create the partitions how …
read moreAfter making a few updates to my site it stopped working after deploying. The issue was that the gem version …
read moreThere are gzip compression options available but when I looked at this a long time ago I found that the …
read moreI have been setting up my recent Sinatra projects with a standard ruby project layout putting all of the application …
read moreUpdate RVM
$ rvm get head
List current versions, and all versions
$ rvm list
$ rvm list known
Select the version you …
read moreSometime a script needs to now the directory that it is executing from, the best solution for this is:
DIR …
Are you running into the following error
Encoding::UndefinedConversionError - "\xE2" from ASCII-8BIT to UTF-8:
If you are using Ruby and …
read moreEntering the following command in to your .bashrc seems like a simple way forward.
xmodmap -e "remove lock = Caps_Lock"
However …
read moreWhile working on this site I wanted to find a simple way of trying out multiple stylesheets for different colour …
read moreWorking on my site design I thought it would be nice to have user selectable stylesheets, say a black text …
read moreIf you are working on a new system or with multiple environments it is good to know what type of …
read moreAnswer:
svn commit -m $'Line 1 \nLine 2'
Committing to subversion on the command line and using escaped …
read moreCron jobs can have there results returned as mail via the unix mail system. If left unchecked for a while …
read moreA simple script for finding temp files from the current directory and below. I often run this before adding a …
read morectrl-r "
Actually ctrl-r reg
, where " is the unnamed register from the last yank or delete.
If you have done …
read moreOriginally written as an assignment for Ruby Mendicant University.
matrix is part of the Ruby Standard Library
A note …
read moreI noticed today that greps recursive function is different to finds recursion.
find ./ -name *.txt
grep -R 'text' *.text
The …
read moreThere does not appear to be a nice way to get a current users real name in ruby. The best …
read moreSuppressing warnings is usually a bad idea but if you understand the risk and want to carry on regardless. When …
read moreThere is a very good presentation Confident Code by Avdi Grimm author of http://exceptionalruby.com/. Previously presented at Cascadia …
read moreBack in 2009 barkingiguana wrote about how explicit returns 'return "String"'
was slower than an implicit return, ie just letting …
This assumes that origin
is the label for github.
Tagging a github repo for my gem releases I do:
$ git …
Previous posts arrays and arrays2
Based on a post by barkingiguana, some idiomatic ruby ways to handle arrays. Ruby tries …
read moreA small standalone script that search through a file doing text substitutions.
1 2 3 4 5 6 7 8 … |
Do you some times see:
FileUtils.rb:93: warning: already initialized constant OPT_TABLE
FileUtils.rb:1176: warning: already initialized constant …
Building on my original Ruby Arrays article a few more things you can do with Ruby Arrays.
Concatenation
a = [1 …
While working on some disk space / folder structure scripts I had several functions which hierarchically search the disk then performed …
read moreInstall Avahi, it like bonjour auto discovery but for linux, then tell it about your servers samba service.
$ sudo apt-get …
The new (July 2011) Mac Book Air is now out, shipping with Lion.
The combination of these two fixes some …
read moreUsing ssh to securely connect with servers from the terminal is pretty easy. set up a public key and a …
read moreUsing ssh to securely connect with servers from the terminal is pretty easy. set up a public key and a …
read moreWhen working with HDLs (Hardware Description Languages) there a few things that could be improved/made easier:
Renaming a file …
read moreRead text file with one line:
Write text with one line :
When reading a text file …
read moreWorking on a joint project an error started showing up when trying to perform migrations.
$ rake db:migrate VERSION=0 …
To make an automatic ActiveRecord database connection using ENV['DATABASE_URL'] The following snippet can be used:
From ActiveRecord 3.2 …
read moreTo connect to a rails style DB config outside of the normal workflow, or using a database.yml in a …
read moreAn old guide is written on the Apple Developer Forum however if you are using Homebrew it is much simpler …
read moreThis vim plugin will allow you to gist directly from vim, simple way is just :Gist to gist entire file …
read morerecenlty after updating rubygems Istarted getting a lot of warning like this when running ruby or executable gems:
NOTE: Gem …
read moreWhen running gem build on a new library I have been working on I started getting the following error:
[ruby_svg_light …
I have not fully read it but it looks like this is a good guide to bash scripting. A few …
read moreIn Vim to insert text before the cursor press 'i', to insert text after cursor 'a' or to edit at …
read moreClasses are a basic Object Orientated Structure which encapsulate state and behaviour. Some times you just require to capture state …
read moreBased on 'Raise the bar, lower the pressure' given by Durran Jordan at ScotRubyConf 2011.
There has been some debate …
read moreI recently heard about the Schwartzian transform, which is a sorting idiom from perl. It allows an array of objects …
read moreIf a torrent application has been running and torrents start showing a status of 'unregistered torrent' a likely cause is …
read moreUsing a while true loop with 'gets' and a case statement, can create a compact command line interface for ruby …
read moreI have just finished some minor updates to the site. The largest is the move to Droid Fonts, Google Fonts …
read moreBased on an old Article I wrote, investigating incase sensitive sorting performance.
I have an active record model call Tag …
read moreUsing Tags (An active record model) to find tags by the tag property:
Tag.find_by_tag("Ruby")
Ruby
Tag.find_by_tag(["Ruby …
After making a few updates to my site I decided to upgrade the version of sinatra I was using in …
read moreThe routes for my site have been growing since adding pagination (/articles/older/) and tag filtering. As well as the …
read moreConsidering various raid strategies I decided that Raid 5 would be too limiting and have previously found raid striping systems …
read moreI have been running into issues with screen when switching to another user:
$ su otheruser
> password
$ screen -x
> Cannot open …
A new very cool plugin for Rubyists using Vim. RubyBlock TextObjects created by Drew Neil from Vimcasts.org. Once installed …
read moreI think it is good practise to create a read only tag when releasing an application. This allows you to …
read moreCurrently OS X 10.6.3 - 10.6.5 the ncursers library is broken. A hacky fix is to copy …
read moreFor various reasons Mac OS X (at least 10.6) can get the system cache out of sync with the …
read moreSince moving to Classy Sinatra applications I have not been able to get put and delete methods to work correctly …
read moreI am currently switching between runing migrations locally on an sqlite3 database and postgres for production on Heroku.
When switching …
read moreRack applications often require a config.ru for deployment. The standard config.ru for classic sinatra applications is well documented …
read moreI have just started to use a sinatra extensions called Sinatra Session. The write up on the main site is …
read moreSinatra Reloader is a sinatra extension which reloads source files while in development mode, this functionality was removed from base …
read moreTo Stop Start and Restart Samba on Mac OS X 10.6:
sudo /usr/sbin/smbd stop
sudo /usr/sbin …
In ruby some times you want to iterate over an array and remove items that meet certain conditions, if using …
read moreI have for a while wondered about an ideal (good) approach to storing api keys in config files in ruby …
read moreThe new EC2-Pricing also includes a new Micro service. This micro service is intended for small apps servicing tens of …
read moreI recently discovered a feature of regular expressions called lookahead. This means for a match the lookahead must exist but …
read moreOne method to save a time and restore it correctly:
def get_time_run
## File Access based on
## http://rubylearning.com/satishtalim …
The Preferences menu in OS x give you the option to turn off Hard Disks whenever possible to save power …
read moreAs this seemed to be a useful post on my old blog I am reposting it. Just in case the …
read moreWhen running a sequel migration I kept getting this error:
Error: NoMethodError: undefined method `compact' for nil:NilClass
My setup …
read moreGrep is a unix (and mac os x) command line tool to search files for text.
1) Search for all …
In Active Record when updating records I used to have an very manual process to this some thing like:
@todo …
When working with databases it is often a requirement to have unique elements (columns) which are not the primary key …
read moreAn example of joining tables through active record models. There is a good tutorial on the basics of Activerecord joins …
read moreI have been wondering how to do this for a while and accidentally discovered it while perusing this heroku page …
read moreCSS or Cascading Style Sheets are used for styling html elements. HTML elements can have id's, which must be unique …
read moreFollowing this article lets you turn a executable java .jar into a mac appliction (.app). The Tools are only available …
read moreAfter adding some USB2 (NTFS formatted) drives to a headless Ubuntu server, they were not auto-mounted so I had to …
read moreI have been trying to use the GeoIP Rack App, by copying this gist in my Rack stack with a …
read morePragmatic TV release there screen casts in iPod, Quicktime and Theora Ogg formats. Since Theora Ogg seems to be the …
read moreI used this as a jQuery reference to hide and show default text in forms.
<head>
<script type=”text/javascript …
After updating my website on webfaction nginx kept saying permission denied and when I tried to view my site I …
read moreThis snippet can be added to you ~/.vimrc to highlight long lines.
" Highlight lines over 80 characters long with red …
To search in Vim just press (apple-f for macvim) / then search string.
/search
This will highlight all occurrences of 'search' …
read moreHomebrew is a new package management system for Mac OS X. A good review/tutorial on EngineYard.
Update 20-August-2010
Then …
This is not necessarily the correct way of creating executable gems but a method which worked for me.
Assuming we …
read moreJust released my first gem 'memory_usage' Version 0.0.1.
$ gem install memory_usage
Assuming the gems folder has been set-up …
read moreIf you are trying to use the 64 bit version of handbrake on Snow Leopard do not for get that …
read moreMacBook3,1 (2007) Intel Core 2 Duo 2.2GHz Hard drive and memory upgraded to 320GB and 4GB
Graphics GMA …
read moreI might have just made up includable, but I like it.
Some times you have written a ruby script (using …
read moreThe *.m4b extension is used for audiobooks on the iTunes Store and is a convenient (if you have an iPod …
read moreI have written a few command line tools in ruby which I use to perform file system maintenance. Mainly sorting …
read moreThere currently does not appear to be any really good torrent file parsers available via the gems system.
rubytorrent seems …
read moreOpen office by default does not have a mode to auto start the presentation when launched. With the ImpressRunner plugin …
read moreI do not like having to use sudo to run development servers for testing web applications. sudo should be reserved …
read moreUsing the new IR ANYWHERE IR OVER IP MODULE you can send web requests that get turned into standard consumer …
read moreDirectory listing can be enabled (disabled by default) by adding this:
autoindex on;
Example usage
http{
server {
#Server with no …
By default git status returned differences in file permissions. To turn if off run:
$ git config core.filemode false
I recently documented how I installed Ruby Enterprise and nginx on Mac OS X. Here we see how to make …
read moreThe '413 Request Entity Too Large' Error message is because you have filled in a form and are submitting it …
read moreDownload ruby enterprise and follow instructions on page. The exact commands I used are:
$ cd ~/bin
$ wget http://rubyforge.org …
A simple Sinatra web app to upload a single file. Also available as a gist, based on http://pastie.caboo …
read moreWith Webfaction you can create new users with there own home area but there is no straight forward way to …
read moreThis feature of ruby keeps catching me out as the behaviour is quite unexpected (by me).
I can use a …
read moreRuby has a .sort method which sorts basic objects. it is case sensitive though so Zebra is before apple. Using …
read moreFluke for mac can be used to get iTunes playing FLAC audio files. However it is currently broken for Snow …
read moreI have just forked and cloned a project on github and discovered *.gemspec files. They are a nice way of …
read moreI recently discovered ||= in ruby. Its main use is for initialising a variable if it does not already exists, this …
read more[Update]
As this is a long post I am putting this update at the top. If you just want to …
When I install gems on my server I do not get any of the documentation which is normally 3-5 times …
read moreWhen displaying blog/articles it is often nice to have previous and next posts. Simply -1 +1 from the current …
read moreJust a short first note to announce the fact that the site is finally up.
We are running on WebFaction …
read moreSinatra 1.0 has been released!
When you install the new version the old one are still left behind. This …
read moreGit has a hand full of GUIs available on Mac OS X, gitk proved a little tricky to use but …
read moreI have been playing around with getting my blog posts timestamped I found the Ruby Time Docs to be very …
read more