Archives: March 2014
There can be a few reasons for this very helpful message. In my case, MySQL's default engine on the production server was MyISAM, while being InnoDB on the development server.
MyISAM does not handle foreign keys, thus the above error. The simple fix is to switch engines:
mysql> ALTER TABLE tableName ENGINE = InnoDB;
Before this blessed day, I lost my time copying my bash scripts on the remote machines where I wanted to execute them through the ssh command. Until now, when I discovered that it is not necessary, thanks to the bash -s flag.
$ ssh user@remote 'bash -s'
From time to time, an inexperienced user for whom I have set up a Lubuntu 12.04 LTS system, inadvertently mess the layout of her taskbar (a lock feature as in KDE's plasmoids would be nice ;-).
While restoring all of her stuff, I couldn't find how to display a shutdown shortcut. This option/item was just not in the widgets list. After a little duckducking, I found I had to edit the following file:
$ sudo leafpad /usr/share/applications/lubuntu-logout.desktop
And comment out1 the line starting with "NoDisplay":
[Desktop Entry] Name=Shutdown Name[zh_TW]=é—œæ©Ÿ Type=Application Comment=Shutdown or Reboot Icon=system-shutdown-panel Exec=lubuntu-logout #NoDisplay=true Categories=Settings;DesktopSettings
After that, I was able to re-add a shutdown icon:
Right Click on LXPanel > Add/Remove Panel Items > Add > Application Launch Bar > Double Click on Application Launch Bar > Preferences > Select Shutdown from the list and Click "Add" > Close > Close
1 or maybe change its value to false, or delete it, be CRAZY!
Help preserve the Kalash tribe in Pakistan by signing this petition on Avaaz.
I recently added a feature to a PHP web application, requiring to run an independent bash script, which connects remotely to another machine through SSH.
When I tested the bash script in command line, it was running with my credentials and used my ~/.ssh/id_rsa.pub to authenticate itself to the remote machine. But when the script was launched by PHP, itself launched by Apache, those credentials were not available. I tried
ssh -i but obviously (everything seems logical afterwards ;-) it couldn't use my private key.
The solution is to have Apache create its own private/public key pair:
$ sudo -u http ssh-keygen -t rsa $ sudo -u http ssh-copy-id username@servername
We use sudo -u to execute ssh-keygen as http user. On Arch Linux, this is the "name" of Apache. It may be different on your system.
On Windows Server, Apache runs by default as NT_AUTHORITY/SYSTEM. The trick here is to run it under another existing user account. To set that option, open Administrative Tools > Services. In the Services window, select Apache2.x > right click > Properties > Log On tab > check "This account" and enter/browse the account of your choice (or create one first) > Apply and restart the service: