Browsing articles in "Command line"
Aug
15

SSHFS Symlinks

Using the default settings, symlink on sshfs don’t work.

You can add an option with the -o flag that will get these working properly:

sshfs user@host:/path/to/mount/ ~/mountpoint -oauto_cache,reconnect,volname=mountname,defer_permissions,transform_symlinks,follow_symlinks

Aug
11

MAMP MySQL won’t start

If you use MAMP for local PHP/MySQL development on OS X then you’re likely to come across this problem with MySQL starting once in a while.

MAMP is a great bit of software but every now and then you will see that MySQL has a problem starting. Checking PHPMyAdmin you might see “Error: Could not connect to MySQL server!”.

Don’t despair, there is a very quick fix:

  1. Quit MAMP
  2. Open terminal and type: sudo killall -9 mysqld
  3. Reopen MAMP

That will fix it but if it’s still not working you can try visiting this MAMP forum thread for more details.

Jul
13

SQL command to reset WordPress password

The quickest and easiest way to change your WordPress admin password. Just enter this SQL command directly on your server.

UPDATE wp_users SET user_pass = MD5('newpassword') WHERE user_login = "admin";
Jun
13

Zimbra mail suddenly stopped working

After a couple of days with no mail I decided that something must be wrong. A quick check of the logs showed a problem.

I tailed the log file while I sent myself an email from another account:

tail -f /var/log/mail.log

The mail tried to be delivered but there was an error occurring:

127.0.0.1[127.0.0.1]:10024: Connection refused

It seems the Zimbra mailserver was not accepting connections. This was easily resolved with a quick restart.

zmcontrol stop

zmcontrol start

May
11

CSS Syntax highlighting in nano

If your server’s version of nano doesn’t have syntax highlighting for CSS you can turn it on yourself.

Just edit your nano config file (which may not exist yet):

nano -w ~/.nanorc

And add the following:

syntax “css” “\.css$”
color brightred “.”
color brightyellow start=”\{” end=”\}”
color brightwhite start=”:” end=”[;^\{]“
color brightblue “:active|:focus|:hover|:link|:visited|:link|:after|:before|$”
color brightblue start=”\/\*” end=”\\*/”
color green “;|:|\{|\}”

 

Save and exit. The next time you open a .css file your code will be highlighted.

Tip courtesy of the nanosyntax project where you can also find code for HTML and lots of other file types.

Sponsored links