Categories
Linux Web Development

Setup PhpStorm to run on OpenSUSE

The problem is that PhpStorm won’t work with the open java openjdk. So you have to install also:

java-1.6.0-sun
java-1.6.0-sun-devel

and not only this. Also you need to add to the .bashrc file in your home directory the following:

#set java paths so PhpStorm can run 
JDK_HOME=/usr/lib/jvm/java-1.6.0-sun 
export JDK_HOME>

Again – it’s for OpenSUSE. On other Linux distributions, the paths may vary.

Categories
Linux

Mercurial error: Not trusting file .hg/hgrc from untrusted user root, group root

I got this error when creating a Mercurial repository on a newly installed Ubuntu server.

The problem turned out that Mercurial will not use the settings in the .hg/hgrc file from a repository if it doesn’t belong to a trusted user or to a trusted group, as various hgrc features allow arbitrary commands to be run.

The solution is to first check what configs file Mercurial trusts and reads:

and find a config file where to put the trust options. For example, I got the following config files listed:

And I chose /home/myusername/.hgrc, which was not existing, so I created it and wrote the following option:

Categories
Linux Web Development

Mercurial shell commands

Switch branches in Mercurial

Careful!!! It discards local changes!
More about branches in Mercurial: http://mercurial.selenic.com/wiki/NamedBranches

Categories
Linux Web Development

My vimrc custom settings

Categories
Linux Web Development

How To Use Amazon EC2 as Your Desktop

How to use a Linux VM from EC2 as a development machine which costs about $25 if you use it only for the work day and stop it after that.

The connect to the EC2 VM is via FreeNX software which works like Remote Desktop for Windows machines and manages the network latency which reduces the lag.

http://blog.restbackup.com/how-to-use-amazon-ec2-as-your-desktop

Categories
Linux Web Development

Run Linux GUI programs from a remote Debian server on a Windows machine

To do this, just need to have installed Xming software. You can download it from here:

http://sourceforge.net/projects/xming/

It will install Putty as well. So, open Putty and type the IP address or the domain name of the Debian server (I’ve tested with Debian, but it should also work with other Linux servers).

After that, on the left tree menu open SSH node and choose X11.

Make sure to check “Enable X11 forwarding” on the right-side pane.

For “X display location” type: localhost:0
(it’s zero 😉 )

And that’s it! Click Open and login as usually in the SSH console. Then from there you can start  a GUI app which will run on your Windows machine. For example:

Categories
Linux

More Linux commands

Zip file:

Zip folder:

“-9” stands for the best compression. It can be skipped.

Unzip file

Untar file:

Delete folder with contents:

Categories
Linux

Installing Mercurial with TortoiseHG for Nautilus on Ubuntu

$ sudo add-apt-repository ppa:mercurial-ppa/releases

$ sudo add-apt-repository ppa:tortoisehg-ppa/releases

$ sudo apt-get update

$ sudo apt-get install tortoisehg tortoisehg-nautilus

Categories
Linux PHP Web Development

PhpMyAdmin increase import file limit size

Starting with version 2.7.0, the import engine has been re–written and these problems should not occur. If possible, upgrade your phpMyAdmin to the latest version to take advantage of the new import features.

The first things to check (or ask your host provider to check) are the values of upload_max_filesize, memory_limit and post_max_size in the php.ini configuration file. All of these three settings limit the maximum size of data that can be submitted and handled by PHP. One user also said that post_max_size and memory_limit need to be larger than upload_max_filesize.

There exist several workarounds if your upload is too big or your hosting provider is unwilling to change the settings:

* Look at the $cfg[‘UploadDir’] feature. This allows one to upload a file to the server via scp, ftp, or your favorite file transfer method. PhpMyAdmin is then able to import the files from the temporary directory. More information is available in the Configuration section of this document.
* Using a utility (such as BigDump) to split the files before uploading. We cannot support this or any third party applications, but are aware of users having success with it.
* If you have shell (command line) access, use MySQL to import the files directly. You can do this by issuing the “source” command from within MySQL: source filename.sql.

Categories
Linux

Ubuntu/Debian install samba

Install Samba:

$ sudo apt-get install samba smbfs

Create Samba user:

$ sudo smbpasswd -a <username>

Add a share:

$ sudo nano /etc/samba/smb.conf

and add at the enf of the file:

# A share of the www folder
[www]
comment = www root folder
read only = no
locking = no
path = /var/www
guest ok = no

That’s it. Even a restart of the Samba server is not required.

In case you can’t write to the folder you’ve shared, chown the folder to the samba user.