Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - GrouchyGaijin

#1
See below for version 3 of the script.
The heavy lifting was done by schragge at the Ubuntu Forum's Programming sub-forum.

So - I wrote a VERY simple script to pull everything off.
It puts the images in a folder labeled with the date.
It resizes the images for posting on my website.
(I live in Sweden, but am from the US, my wife is from Japan - so we have a website devoted to our kids.  Both sets of Grandparents love it.)
It puts the videos in a folder I use to store clips until I can edit them.
It removes all the thumbnail (.THM) files from the camera.

Anyway,  here it is:

### Unload_camera ###
### By Grouchy Gaijin ###
### Tweaked by Sector_11 ###
### This is really simple.  You only need to install GraphicsMagick to resize the images and then adjust
###the paths of the folders. ###
### Make the script executable chmod +x Unload_camera and call the script from the camera. ###


#!/bin/bash
echo "Are you SURE you are in the right folder??"
##### Because I am a dumbass and sometimes run this from the wrong folder. #####
echo "ALL files in the clips folder will be deleted."
#### Because I always forget to delete them after I post a video #####
read -p "If so, press the [Enter] key continue..."

# now is the folder where the script will put your photos #
# I have the date set in the format of 15-Apr-2013 #
now=$(date +"%d-%b-%Y")

# gm mogrify is the GraphicsMagick command to resize all jpeg files in the source direcory #

gm mogrify -resize 720x720 *.jpg *.JPG

# change the path of mkdir to where ever you want the new direcory to be #
mkdir ~/path/to/$now &&
mv *.JPG ~/path/to/$now
mv *.jpg ~/path/to/$now

# The script will pull any videos off your camera and put them in the assigned direcory #
# My direcory is called clips.  Before moving new videos into the clips direcory, the script will delete # # anything it finds there. #

rm -f /path/to/the/direcory/where/you/store/all/of/your/clips/before/editing/*

# The script also removes any video thumbnail files from the camera #
# I added .MOV and .mov in case you pull from a drive with Mac files on it (iPhone, cough cough) #
rm *.THM
mv *.MPG /path/to/destination/folder/
mv *.MOV /path/to/destination/folder/
mv *.mov /path/to/destination/folder/
#2
General Support / Long urls in mutt
March 30, 2013, 12:29:19 PM
Hi Guys,

I figured that since Mutt is included in VSIDO someone might have an answer about a problem I've noticed with Mutt.
I am using Mutt-patched from the Ubuntu repository (Yes, I am one of the unwashed.)
Anyway, it works really well except that if a url extends to multiple lines, Mutt can't figure it out and clicking leads to a page not found error.

I tried copying the url, but when I highlight the lines with the url I end up copying a bunch of other stuff that is not in the url (like part of the list of folders in the Mutt side panel, for example).

Does anyone know a way to deal with long urls aside from opening up Thunderbird?

Thanks for any advice, I really appreciate it.
#3
How To's / Multi lingual spell checking in mutt
February 05, 2013, 09:44:44 PM
I started using mutt a few days ago and found that I missed the ability of spell checking in both Swedish and English.
There are several ways to solve this problem, so you might know one that is better / easier than the solution I use.

1. You could just set an editor like abiword to be the mail editor in mutt.  In the .muttrc file add set editor="abiword"
I didn't want to do this, because after all, mutt runs in the terminal and using abiword (or whatever gui text editor) seems to violate the spirit of the thing.  ;)

2. You could use vim as the editor.  I had already managed to get vim to spell check Swedish and English, so that would be the obvious choice, right?  (Shhhh I don't like vim at all - I keep forgetting the key combinations to do things, not to mention to hit the escape key before I try to move to a misspelled word.)

3. I wanted to use nano.  Why, because it is easy and runs in the terminal.

The problem is that nano comes with a terrible spell check that only tells you which words it doesn't know.  If I knew how to spell them, would they be wrong?  Aspell on the other hand, offers useful suggestions.  I wanted to use Aspell.

The problem is that Aspell didn't like loading the en_US and sv_SE dictionaries together.  I tried making a custom dictionary and that worked OK, except not in mutt.  In mutt, I'd get a spell check abnormal failure.

Then I found this bash script that let's me choose which dictionary I want to load after I invoke the spell check command.

#!/bin/bash
read -p "Aspell: Select language: (US) SV" -s -n 1
case $REPLY in 
2|[Sv]) opts=( -l sv_SE.UTF-8 ) ;;
*) opts=( -l en_US.UTF-8 ) ;;
esac
exec aspell ${opts[@]} -e -c $1


Next I edited the nanorc file which on my system is at
/etc/nanorc
I changed the set speller setting to point to the script
set speller "/path/to/the/script/alpine_aspell"

Now when I hit the spell check command in nano (which my mutt uses) I get a choice: Press 1 for English or 2 for Swedish - and I'm good to go.

This worked for me.  I hope you find it useful.
#4
Introductions / Hej from Sweden
January 20, 2013, 08:54:25 PM
Hi Guys,

Sector_11 turned me onto this forum as the place to go for Conky talk.
I live in Sweden, but am not Swedish.  The name GrouchyGaijin comes from my personality - my wife and kids have been known to tell me that I'm being grouchy.  Gaijin (外人 if you read Kanji) basically means outsider or non-Japanese.  Since my wife is from Japan and I'm not - well then - I'm a gaijin.   :D