Posty

Wyświetlanie postów z październik, 2009

Maven deploy with ftp

in
[code lang="shell"]
vim ~/.m2/settings.xml
[/code]
add
[code lang="xml"]
<settings>
...
<servers>
<server>
<id>ftp-repository</id>
<username>user</username>
<password>pass</password>
</server>
</servers>
</settings>
[/code]
in project file:
[code lang="shell"]
vim pom.xml
[/code]
add
[code lang="xml"]
...
</dependencies>
...
<distributionManagement>
<repository>
<id>ftp-repository</id>
<url>ftp://ftpServerA.com</url>
</repository>
</distributionManagement>
...
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-alpha-6</version>
</extension>
</extensions>
</build>
...
[/code]
[code la…

Ssh keys authorization

[code lang="shell"]
// generujemy swój klucz ssh
ssh-keygen
//na wszystkie pytania odpowiadamy enterem
//wynik otrzymujemy w:
~/.ssh$ ls -al
id_rsa // klucz prywatny
id_rsa.pub // klucz publiczny
//kompiujemy klucz publiczny na serwer
scp ~/.ssh/id_rsa.pub remoteuser@remotehost:~/
//dopisujemy go kluczy na serwerze
cat id_rsa.pub >> ~/.ssh/authorized_keys
//usuwamy plik na serwerze
rm id_rsa.pub
//włączamy autoryzację po kluczach w
sudo vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
//restartujemy ssh na serwerze
/etc/init.d/ssh reload
//teraz logując się po ssh na serwer nie będzie pytania o hasło ;-)
[/code]

Screen tips

* Uruchamimay program w screen.
[code lang="shell"]
screen -S torrent rtorrent
screen <opcje> <parametry> <nazwa programu>
[/code]
* Wyście ze screen'a:
[code lang="shell"]
ctrl + a, d
[/code]
* Powrót do screen'a:
[code lang="shell"]
screen -x torrent
[/code]
* Lista screen'nów:
[code lang="shell"]
screen -list
[/code]
* Powrót do screen'a z listy:
[code lang="shell"]
screen -x 31234
[/code]
* Po uruchomieniu pierwszego screen'a jesteśmy w konsoli 0;
* Aby otrzymać następną konsolę w screen'ie robimy:
[code lang="shell"]
ctrl + a, c
[/code]
* Przełączamy się między konsolami przy pomocy:
[code lang="shell"]
ctrl + a, #
// # - oznacza numer konsoli
[/code]
* Aby usunąć konsolę:
[code lang="shell"]
exit
[/code]

VMware keyboard problem

in file
[code lang="shell"]
vim /etc/vmware/config
[/code]
or
[code lang="shell"]
~/.vmware/config dodajemy:
[/code]
this line
[code lang="shell"]
xkeymap.nokeycodeMap = true
[/code]

Ubuntu no eth0 in VMware

After copy ubuntu vitual machine you need change MAC and clear file
[code lang="shell"][/code]
vim /etc/udev/rules.d/70-persistent-net.rules
[code][/code]

Adobe AIR automatic updates

main Application:
[code lang="xml"]
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="checkForAppUpdate()">
<mx:Script>
<![CDATA[
import air.update.events.UpdateEvent;
import air.update.ApplicationUpdaterUI;
private var appUpdater:ApplicationUpdaterUI = new ApplicationUpdaterUI;
// checks to see if an updated version of the app is up.
private function checkForAppUpdate():void
{
appUpdater.configurationFile = new File(app:/updateConfig.xml);
appUpdater.isCheckForUpdateVisible = false;
appUpdater.initialize();
appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate);
appUpdater.addEventListener(ErrorEvent.ERROR, onError);

Set up together Thunderbird, Google Calendar, Remember The Milk

Manage Google Calendar and Remember The Milk in Mozilla Thunderbird.

Install this plugings:

Lightning Plugin for Thunderbird: http://www.mozilla.org/projects/calendar/lightning/

Google Calendar Provider: https://addons.mozilla.org/en-US/thunderbird/addon/4631

RTM: https://addons.mozilla.org/en-US/sunbird/addon/7125

more info about Google Calendar and Mozilla Thunderbird: http://ubuntuforums.org/showthread.php?t=540330

Port check - netstat

[code lang="shell"]
netstat -lp
[/code]

Installing Postgres on Ubuntu

1. Installing postres
[code lang="shell"]
sudo apt-get install postgresql postgresql-client postgresql-contrib
[/code]
2. Postres database password change
[code lang="shell"]
sudo su postgres -c psql
postgres=# ALTER USER postgres WITH PASSWORD 'newPassword';
postgres=# q
[code]
3. Remove password for user on ubuntu
[code lang="shell"]
sudo passwd -d postgres
[/code]
4. Add password for user
[code lang="shell"][/code]
sudo su postgres -c passwd
[code][/code]

Instalacja Redmine with Apache, Ruby Enterprise, Phusion Passenger

[code lang="shell"]
wget http://rubyforge.org/frs/download.php/57098/ruby-enterprise_1.8.6-20090520_i386.deb
wget http://rubyforge.org/frs/download.php/56909/redmine-0.8.4.tar.gz

sudo apt-get install apache
sudo apt-get install build-essential apache2-prefork-dev libapr1-dev

sudo dpkg -i ruby-enterprise_1.8.6-20090520_i386.deb

sudo -i
export PATH=/opt/ruby-enterprise/bin:$PATH
passenger-install-apache2-module
[/code]
Tworzymy plik /etc/apache2/mods-available/passenger.load o treści:
[code lang="shell"]
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
[/code]
oraz /etc/apache2/mods-available/passenger.conf o treści:
[code lang="shell"]
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2
PassengerRuby /opt/ruby-enterprise/bin/ruby
[/code]
a potem aktywujemy stworzone moduły przez
[code lang="shell"]
sudo a2enmod passenger
[code]
Instalacja redmine
[code lang="shell"]
$ cd …

Add and remove user in ubuntu

[code lang="shell"]
adduser UserName
userdel UserName
rm -r /home/UserName
[/code]

Create git remote reposytory

Login to remote server
[code lang="shell"]
ssh git@REMOTE_SERVER
[/code]
Once logged in
[code lang="shell"]
mkdir example.git
cd example.git
git --bare init
[/code]
Local host
[code lang="shell"]
mkdir example
cd example
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@REMOTE_SERVER:example.git
git push origin master
[/code]

Ubuntu Skype Problem with Audio Playback

[code lang="shell"]

killall pulseaudio
sudo apt-get remove pulseaudio
sudo apt-get install esound
sudo rm /etc/X11/Xsession.d/70pulseaudio

[/code]

Using JFreeChart with Seam

Graphic statistics in Seam with JFreeChart.
[code lang="java"]
package example.chartprocesser;

@Name("chartprocesser")
public class ChartProcesserBean {

@In
EntityManager em; // Entity Manager to access the database

byte[] chart; // chart image (.png) as a byte array

@Factory(value="chart")
public void createChart() {

DefaultCategoryDataset ds = this.getData;

JFreeChart chart = ChartFactory.createLineChart(
"TITLE",
"Category Label",
"Axis Lable",
ds,
PlotOrientation.HORIZONTAL,
false,
false,
false
);

try{
this.chart = ChartUtilities.encodeAsPNG(chart.createBufferedImage(400, 400));
} catch (IOException e){
e.printStackTrace();
}

}

private DefaultCategoryDataset getData(){
//get the data and put into DefaultCategoryDataset
//Then return it.
}
}
[/code]
In your JSF page:
[code lang="xml&q…

Installation SyntaxHighlighter on page

1.In the blogger,Click on Layout tab ->Edit HTML and put following things Before </head>

[code lang="html"]
<link href='http://syntaxhighlighter.googlecode.com/svn/trunk/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js'/>
[/code]



2. put following things Before </body>
[code lang="html"]
<script language="javascript">
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>
[/code]


3. Convert your code using any WYSISYG editor (Paste in editor and copy html view of editor) or copy your code in notepad and replace all < in &lt; etc.
4. Put your updated code between:
[code lang="xml"]
<pre n…

Instalacja systemu linux z usb pendriv'a

Gdy nie mamy pod ręką płytki CD/DVD aby nagrać dystrybucję możemy wykonać instalację z usb pendriv'a wykonując następujące kroki:

1. ściągamy program UNetBootin,
2. ściągamy obraz iso netinstall naszej dystrybucji np. centos.
3. przygotowujemy pendrive usb za pomocą programu pkt. 1.,
4. restart PC i boot z USB,
5. ustawiamy źródło danych http i parametry:
Host: isoredirect.centos.org,
Directory: centos-5/5.2/os/i386/,
6. dalej już idziemy wg. instalacji danej dystrybucji Linuksa.

Installing Xen virtualization on CentOS

Installing Xen On CentOS 5.0 (i386)
Version 1.0
Author: Falko Timme
Last edited 06/08/2007

This tutorial provides step-by-step instructions on how to install Xen (version 3.0.3) on a CentOS 5.0 system (i386).

Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called "virtual machines" or domUs, under a host operating system (dom0). Using Xen you can separate your applications into different virtual machines that are totally independent from each other (e.g. a virtual machine for a mail server, a virtual machine for a high-traffic web site, another virtual machine that serves your customers' web sites, a virtual machine for DNS, etc.), but still use the same hardware. This saves money, and what is even more important, it's more secure. If the virtual machine of your DNS server gets hacked, it has no effect on your other virtual machines. Plus, you can move virtual machines from one Xen server to the next one.

I will use CentOS 5…

Install Postgres 8 on Centos

How to Install Postgres 8 on RHEL/Centos in 3 minutes

I want to share quick and specific instructions for the installation of the Postgres 8 database on Red Hat Enterprise Linux 5 / Centos 5. I am using Yum for this installation. To make sure that you have everything needed do:
[code lang="shell"]
yum list | grep postresql
[/code]

and verify that you see:
[code lang="shell"]
postgresql.i386, postgresql-server.i386 and postgres-libs.i386 (i386 if on non-64 bit version)
[/code]

Centos installation comes with postgresql-lib installed. If it does not, do:
[code lang="shell"]
yum install postgresql-libs
[/code]

Now, the general installation. As root install postgres core:
[code lang="shell"]
yum install postgresql
[/code]

Install postgres server:
[code lang="shell"]
yum install postgresql-server
[/code]

Now create postgres user:
[code lang="shell"]
adduser postgres
[/code]

Create the datafile for the database:
[code lang="shell"]
mkdir -p /usr/loc…

Rezerwat - Zaopiekuj się mną

Piosenka o kwiatach Marek Roman

Róże Europy - Jedwab

Przepraszam - Sztywny Pal Azji

Installing Subversion Server on CentOS

1. Install a couple of packages via yum:

[code lang="shell"]
$ sudo yum install httpd subversion mod_dav_svn
[/code]


2. Create a directory to store the svn repositories in :
[code lang="shell"]
$ sudo mkdir -p /var/lib/subversion/repositories
$ sudo chown -R apache:apache /var/lib/subversion
[/code]


3. Because I make and delete repositories quite a lot, i made a script to build them. Save this script somewhere and make it executable. I saved it as /bin/make-repos so i can use it from anywhere.
[code lang="shell"]
#!/bin/sh

if [ $# -ne 1 ]; then
echo 1>&2 Usage: $0 repository_name
exit 127
fi

echo "Sudoing...";
sudo svnadmin create --fs-type fsfs /var/lib/subversion/repositories/${1}
sudo chown -R apache:apache /var/lib/subversion/repositories/${1}
sudo chmod -R g+w /var/lib/subversion/repositories/${1}
sudo chmod g+s /var/lib/subversion/repositories/${1}/db
[/code]


4. Create a new file /etc/httpd/conf.d/svn.conf with the following contents :
[code lang="…

Installing Trac on CentOS

Installing Trac on CentOS

1. Before you do anything, go ahead and install subversion
2. Install the python easy install tool:

[code lang="shell"]
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ sudo python ez_setup.py
[/code]

3. Install Trac :

[code lang="shell"]
$ sudo easy_install Trac
[/code]

4. Install mod_python :
[code lang="shell"]
$ sudo yum install mod_python python-devel
[/code]


5. Create a new Trac project :
[code lang="shell"]
$ sudo trac-admin /var/www/trac/my_project initenv MyProjectName sqlite:db/trac.db svn /var/lib/subversion/repositories/my_project/
[/code]



Obviously adjust the paths, project name etc according to your setup.

if you get this error :
[code lang="shell"]
ExtractionError: Can't extract file(s) to egg cache
[/code]


The following error occurred while trying to extract file(s) to the Python egg
cache:
[code lang="shell"]
[Errno 13] Permission denied: '/root/.python-eggs'
[/code]


The Python egg cache dir…