Launch Sublime Text 3 from the command line from OS X

Written by Leif Stenfeldt. Posted in OS X, Tips

If the path /usr/local/bin does not exist, then create it.

sudo mkdir /usr/local/bin

Create the symbolic link:

sudo ln -s “/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl” /usr/local/bin/subl

close and reopen terminal and then your are set.

Testing

Open a Terminal window and run:

1
sublime ~/Documents

or

1
2
cd
sublime Documents/

or even

1
2
# to open the entire current directory
sublime .
1473 views

How to ‘insert if not exists’ in MySQL?

Written by Leif Stenfeldt. Posted in Mysql, PHP, Tips

see http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html

there’s also INSERT … ON DUPLICATE KEY UPDATE syntax, you can find explanations on dev.mysql.com


Post from bogdan.org.ua
18th October 2007

To start: as of the latest MySQL, syntax presented in the title is not possible. But there are several very easy ways to accomplish what is expected using existing functionality.

There are 3 possible solutions: using INSERT IGNORE, REPLACE, or INSERT … ON DUPLICATE KEY UPDATE.Imagine we have a table:

CREATE TABLE `transcripts` (
2074 views

Compare two MySQL databases

Written by Leif Stenfeldt. Posted in Tips

If you’re working with small databases I’ve found running mysqldump on both databases with the --skip-comments and --skip-extended-insert options to generate SQL scripts, then running diff on the SQL scripts works pretty well.

By skipping comments you avoid meaningless differences such as the time you ran the mysqldump command. By using the --skip-extended-insert command you ensure each row is inserted with its

1635 views

Word tips

Written by Leif Stenfeldt. Posted in Tips

Ctrl + F1: Vis eller fjern topfanen (Ribbon).
Ctrl + K: Indsæt et hyberlink på den markerede tekst.
Ctrl + F: Fed (dansk version) / Åben et søgefelt (engelsk version). Ctrl + B er søgefeltet på dansk.
Alt + Ctrl + 5: Split eller fjern split i et dokumentvindue.
Ctrl + Backspace: Slet ét ord mod venstre.
Shift + F3: ændre bogstavstørrelse (R –> r) på de markerede ord.

1497 views

Quake II server

Written by Leif Stenfeldt. Posted in Server, Tips

Quake II – Co-Op Dedicated Server Tutorial

I think this is the best way to create a Co-Op server.

  • Create a .bat file in your Quake II folder. Name it anything you like.
  • Edit the .bat file with WordPad. It should look like this:

Code:
@echo off
quake2.exe +set dedicated 1 +exec servercoop.cfg
exit

  • Now go into your baseq2 folder. It’s in your Quake II folder.
  • Create a .cfg file. Name it “servercoop.cfg”.
  • Edit the .cfg file with WordPad. It should look like this:

2018 views

CBT Soap Fault from VMWare when runnnig Veeam backup

Written by Leif Stenfeldt. Posted in Errors, Server, Tips

The error means that Veeam cannot identify what blocks have changed. This could have numerous causes, for example, your storage was powered down without to shut down the VMs via guest OS first.

The fix is fairly simple but it does require powercycling the VM, see KB:1113 – How to reset CBT. From the KB article:

  1. Power off the VM
  2. Right click the VM, click “Edit settings”, find the “Options” tab and click “Configuration Parameters”
  3. Set the “ctkEnabled” value to false
  4. Set the “scsi0:x.ctkEnabled” value to false for each disk of the VM in question5. Open the source folder and remove any -CTK.VMDK files.
  5. Power on the VM
  6. Power off the VM again. This step is needed to update the CTK table.
  7. Power on the VM
  8. Rerun Backup or Replication job to re-enable CBT
932 views

How to install Sublime text on linux

Written by Leif Stenfeldt. Posted in Tips

For Sublime-Text-2:

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

For Sublime-Text-3:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

Source: https://gist.github.com/dantoncancella/4977978

1367 views