By Ammon | Published:
June 14, 2010
The following command will create an image called montage.png that is a collection of all the .png files in the current directory. Images larger than 150px on a side will be resized, but aspect ratio is preserved. The images are separated by a 2px offset.
$ montage *.png -geometry 150×150\>+2+2 montage.png
By Ammon | Published:
April 21, 2010
The following command will shrink all .jpg’s in the current directory that are larger than 500px and center them on a square 500×500px canvas. Since the aspect ratio of the original images will be preserved and not all of the originals are square, the left over space will be filled with an off-white color. [...]
Posted in Solutions | Tagged Image Magick |
By Ammon | Published:
April 21, 2010
The following command will resize any and all .jpg’s in the current directory that are larger than 500px on either side and put them in a file called ‘resized’. Aspect ratios will be respected, and the same filenames will be used for the modified images.
mogrify -path resized -resize 500>x500\> *.jpg
Yes, you have to use [...]
Posted in Solutions | Tagged Image Magick |
By Ammon | Published:
April 1, 2010
Its true, don’t waste your time with strange scripts and such if you’re trying to upload an .sql file that exceeds the limit. Just give up and use source. Note: don’t be confused that I don’t capitalise my MySQL commands. Its my silent protest against standard MySQL syntax: I think capitalising commands you [...]
By Ammon | Published:
March 29, 2010
All this comes from here:
https://help.ubuntu.com/community/ApacheMySQLPHP
In the teminal:
$ sudo tasksel install lamp-server
$ sudo apt-get install phpmyadmin
$ sudo gedit /etc/apache2/apache2.conf
Add the following to the end of this file: “Include /etc/phpmyadmin/apache.conf”
Edit the /etc/php5/apache2/php.ini file and increase the memory_limit value. I used 64M, but that may be overkill.
Also posted in Apache, Linux, Ubuntu |
By Ammon | Published:
February 25, 2010
When I’m building websites especially, I have to work with a lot of deeply nested files. But typing cd ~/public_html/websitename/wp-content/themes/themename/ in the terminal every time is giving me carpal tunnel, so I found a better way:
First open ~/.barshrc in a text editor and uncomment lines 73 through 75 so they look like this:
if [ [...]
Also posted in Linux, Ubuntu |
By Ammon | Published:
February 17, 2010
Before you do anything, back up your original config files. I used to just create a copy of the files with the suffix “.bak” (sudo cp example.conf example.conf.bak), which works, but creates a lot of clutter. Now I use a great little utility called etckeeper which automatically places all files in /etc under [...]
By Ammon | Published:
February 11, 2010
The following code, when included in the functions.php file in your Wordpress child theme, will correctly load Mootools and a custom script. This is the only way I am able make custom scripts work, but you hear a lot of stuff out there on the interweb…
<?php
function add_js() {
$stylesheet_dir = get_bloginfo(’stylesheet_directory’);
[...]
Also posted in Wordpress |
By Ammon | Published:
January 19, 2010
In the terminal, type:
$ sudo apt-get install apache2
$ sudo apt-get install php5 libapache2-mod-php5 php5-mysql
$ sudo apt-get install mysql-server
$ sudo apt-get install phpmyadmin
Just agree when it asks you stuff.
By Ammon | Published:
January 19, 2010
The service service_name command command can be used to start, stop, or restart anything in your /etc/init.d directory. From the command line, use it like this:
$ sudo service apache2 start
$ sudo service apache2 stop
$ sudo service apache2 restart