czwartek, 29 marca 2012

Non standard linux compilation...

I wanted to compile rTorrent on machine I don't have root access. User compilation is always harder - you can't touch system files nor install any packages to ensure that all dependencies are met. Here are problems I ran into, and some solutions, which probably will work for other projects as well.

I have used ~/usr directory as placeholder for apps that require installation. I will refer to that directory anywhere below.

1. Problems with CppUnit:
possibly undefined macro: AM_PATH_CPPUNIT 
syntax error near unexpected token `1.9.6'
rTorrent uses autogen.sh script to generate proper configuration script. So, first thing is to compile CppUnit, be sure to remember to pass --prefix=$HOME/usr to CppUnit's configure script. make & make install as usual.
However that wont work, yet. We also have to set ACLOCAL_FLAGS variable, so let's execute:
export ACLOCAL_FLAGS="-I $HOME/usr/include -I ../cppunit-VERSION"
All right, now you're ready to go:
./autogen.sh
./configure --prefix=$HOME/usr
make


2. My second problem was sigc++...
No package 'sigc++-2.0' found
Okay, get sources, configure with prefix, make and install. Great, but rTorrent still don't recognize it. The solution is to set another variable:
export PKG_CONFIG_PATH=$HOME/usr/lib/pkgconfig
Now rTorrent should configure itself without any issues :)

And one last thing... if you have some problems during make but configure went just fine, clean your sources:
rm -f scripts/{libtool,lt*}.m4


Good luck! :)

czwartek, 1 września 2011

Amazon EC2: Permission denied on SSH

I run into a problem with connecting to Amazon EC2 instance using RSA key. I've put my public key on the server in authorized_key's file but the remote server were denying my connection with:

Permission denied (publickey).

If you ever run into that kind of problem try to check your remote logs, everything became clear when I did that:

tail -f /var/log/secure
(...)
Authentication refused: bad ownership or modes for directory /home/----/.ssh

So, I simply changed .ssh directory permissions to 0700 and it start to work. Great!

sobota, 20 sierpnia 2011

SSH login using keys

If you login on some remote ssh server often, you should consider using ssh keys to login without authorizing with password every each time. To achieve that goal server you want to login to need to know your local account and then let you in without asking for password. So first of all we need to generate key to identify local account:

ssh-keygen -t rsa

You should not enter any passphrase. Now you should have ~/.ssh/id_rsa.pub file (it's a default file, you could change the path of course) that is your public key that will be seen from the outside (kind of security passage ;)). So you need to put that key on the server, so it could identify your account. To do it you should place content of your local id_rsa.pub to the ~/.ssh/authorized_keys on the server (if this file does not exists - create it, f it exists do not erase it, just append your key on the end of the file - you can access you server's account via public keys from many remote accounts if you want to).
To copy your key to the server you can use copy & paste if you use some gui or use "oldschool" method:

cat .ssh/id_rsa.pub | ssh server_login@server_address 'cat >> .ssh/authorized_keys'

After that you should be able to login on the server without any password. It is also very useful if you have some other services on the server that use ssh protocol - git is a good example.

niedziela, 31 lipca 2011

git remote repository

Let's assume we have some external server that we want to use as main/backup repository and we have ssh access to this server. First thing is to create base repository on the server:

mkdir PROJECT.git
cd PROJECT.git
git init-db --bare

Then, on the client side:
cd PROJECT
git init

git remote add origin SERVER_PATH
git config branch.master.remote origin
git config branch.master.merge master

git add .
git commit -a -m 'initial commit'
git push origin master

The SERVER_PATH should be like: username@server.address.net:~/path_to_PROJECT.git

And we are done.

sobota, 19 grudnia 2009

NTFS and MacOS

Readonly NTFS partitons are visible from the start in Leopard and Snow Leopard. If you want to have rw possibilities - that's another story.

Leopard: NTFS-3G is good, working solution.

Snow Leopard: rw mode is built in but not used by default. To make it work:
First - check mounted partitions and choose disk-partition number, simply enter in terminal:
mount
Second - if you know which partition is your desired ntfs partition, then check its id (let's pretend ntfs partition is first partition on second disk - disk2s1):
echo `sudo /System/Library/Filesystems/ntfs.fs/ntfs.util -k disk2s1`
Third - ok, we have its id. Now edit /etc/fstab file (or create new if you don't have it) and put there (remember to put there your real disk UUID!):
UUID=your_ntfs_partition_id none ntfs rw
Done. Just restart. Complicated? Well, its not that simple as installing some software but with three really simple steps your system is untouched and everything works. And there is another problem with NTFS-3G - it's not working on SL x64 ;) so for me its useless anyway.

piątek, 18 grudnia 2009

TextMate problems on SnowLeopard (Command+Arrows)

I was very upset when i found out that one of most used editor shortcuts (Command+Left Arrow = windows' home, Command+Right Arrow = windows' end) doesnt work on SnowLeopard. However it's not a big problem - TextMate have special page for SL problems and there is bundle to handle this problem.

czwartek, 17 grudnia 2009

SnowLeopard & ATI 4670

Well... ATI 4670 with SnowLeopard on PC it's tricky for me... there are many described ways to make it work but none worked for me. Magic was: i had it running for about a week and then suddenly it stopped working! I looked everywhere, order another cable (it haven't came till now ;)), i was pissed off so much that i even tried to back to windows (which caused me another pain)...

Ok, so here is the deal: it works with PCI_EFI 10.5, vanilla kexts, "GraphicsEnabler=y -pci0" (-pci0 or -pci1 depends on motherboard type) arguments at boot time (it's all kind of normal with SL on PC) but (!) my vga monitor have to be plugged into vga output WITH dvi2vga dongle inserted into dvi slot! If i put my monitor into dvi through dvi2vga or vga only - there is no way my 4670 would work.

I really have to buy Mac.