Posty

Wyświetlanie postów z 2009

Ubuntu Karmic nice themes

[code lang="shell"]
vim /etc/apt/source.list
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -
apt-get install zgegblog-themes
[/code]
http://www.ubuntugeek.com/nice-themes-for-ubuntu-9-10-karmic-users.html

Adobe AiR SDK linux ubuntu config

Copy and replace air sdk to flex sdk
Fix air sdk runtimes:
[code lang="shell"]
rm FLEX_SDK/runtimes/air/mac
ln -s FLEX_SDK/runtimes/air/mac FLEX_SDK/runtimes/air/linux
[/code]

Adobe AiR update

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);

}

// if ther…

Percellite Ubuntu Clipboard Manager

[code lang="shell"]
sudo apt-get install percellite
[/code]

ctrl + c
ctrl + alt + H
ctrl + v

Apt-mirror setup local ubuntu package repository

Server setup
[code lang="shell"]
sudo apt-get install apache2
sudo apt-get install apt-mirror
sudo vim /etc/apt/mirror.list
deb http://archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
sudo apt-mirror
sudo vim /etc/cron.d/apt-mirror
0 4 * * * apt-mirror /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log
#daily 04:00 AM
sudo ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ /var/www/ubuntu
[/code]
Client setup
[code lang="shell"]
sudo vim /etc/apt/source.list
deb http://192.168.1.3/ubuntu karmic main restricted universe multiverse
deb http://192.168.1.3/ubuntu karmic-updates main restricted universe multiverse
deb http://192.168.1.3/ubuntu karmic-security main restricted universe multiverse
sudo links http://192.168.1.3/ubuntu
[/code]

Ssh remove server name

Remove server name from local secure ssh list.
[code lang="shell"]
ssh-keygen -R server.example.com
[/code]

OpenVPN config setup

[code lang="shell"]
openvpn --config VPN.conf
[/code]

Ssh copy public key

Copy public ssh key to user@host
[code lang="shell"]
ssh-copu-id -i id_rsa.pub login@host
[/code]

NFS Server Client Tutorial

NFS Server
Install NFS Server Support
[code lang="shell"]
sudo apt-get install nfs-kernel-server nfs-common portmap
[/code]
Editing /etc/exports
[code lang="shell"]
sudo vim /etc/exports
/files 192.168.1.0/24(rw,no_root_squash,async)
sudo /etc/init.d/nfs-kernel-server restart
sudo exportfs -a
[/code]
NFS client
Install NFS client support
[code lang="shell"]
sudo apt-get install portmap nfs-common
sudo mount server.mydomain.com:/files /files
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart
[/code]
Mounting at boot using /etc/fstab
[code lang="shell"]
sudo vim /etc/fstab
server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
[/code]

Tomcat 6 Ubuntu install for multiple instances

Install SUN JAVA6 JDK
[code lang="shell"]
root@h apt-get install sun-java6-jdk
[/code]
Install TOMCAT6 user instances
[code lang="shell"]
root@h: apt-get install tomcat6-user
[/code]
Add new user:
[code lang="shell"]
root@h: adduser tomcatA
[/code]
Create TOMCAT6 user instance:
[code lang="shell"]
tomcatA@h: tomcat6-instance-create tomcat
[/code]
Tomcat configure(port):
[code lang="shell"]
tomcatA@h: vim tomcat/conf/server.xml
[/code]
Tomcat start/stop:
[code lang="shell"]
tomcatA@h: ./tomcat/bin/startup.sh
tomcatA@h: ./tomcat/bin/shutdown.sh
[/code]
Add to autostart:
[code lang="shell"]
root@h: vim /etc/init.d/tomcatA
#!/bin/bash
# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sudo -u tomcatA /home/tomcatA/tomcat/bin/startup.sh
;;
stop)
sudo -u tomcatA /home/tomcatA/tomcat/bin/s…

Git: SVN -> Git

Monitoring: Cacti

Monitoring: Nagios

Monitoring: Munin

Eclipse Maven Plugin m2eclipse

Eclipse Update and Add-ons site:

http://m2eclipse.sonatype.org/update/

Scala IDE in Eclipse

How to configure Scala IDE in Eclipse

Download Eclipse: http://www.eclipse.org/downloads/
Add Software Updates and Add-ons location: http://www.scala-lang.org/scala-eclipse-plugin
Install: Scala IDE plugin

Tar tutorial

Create, Extract, See Contents
The tar program takes one of three funcion command line arguments (there are two others I won't talk about).

c - to create a tar file, writing the file starts at the beginning.
t - table of contents, see the names of all files or those specified in other command line arguments.
x - extract (restore) the contents of the tar file.

Compression, Verbose, File specified
In addition to a function command line argument the arguments below are useful. I usually use z and f all the time, and v when creating/extracting.

f --- specifies the filename (which follows the f) used to tar into or to tar out from; see the examples below.
z --- use zip/gzip to compress the tar file or to read from a compressed tar file.
v --- verbose output, show, e.g., during create or extract, the files being stored into or restored from the tar file.

Examples
To tar all .cc and .h files into a tar file named foo.tgz use:

[code lang="shell"]
tar cvzf foo.tgz *.cc *.h
[/code]

To s…

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…

Thunderbirt + Google Calendar + RTM

http://ubuntuforums.org/showthread.php?t=540330

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

git remote repo

# login to remote server
ssh git@REMOTE_SERVER

# once logged in
mkdir example.git
cd example.git
git --bare init

#local host
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

dodawanie usuwanie uzytkownika ubuntu linux

adduser UserName
userdel UserName
rm -rf /home/UserName

instalacja redmine

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

Tworzymy plik /etc/apache2/mods-available/passenger.load o treści:

LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
oraz /etc/apache2/mods-available/passenger.conf o treści:

PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2
PassengerRuby /opt/ruby-enterprise/bin/ruby

a potem aktywujemy stworzone moduły przez
sudo a2enmod passenger

Instalacja redmine
$ cd /apps
$ sudo tar xzvf ~/redmine-0.8.4.tar.gz
$ sudo ln -s redmine-0.8.4 redmine
$ sudo chown -R www-ruby.www-ruby redmine/public redmine/log redmine/config
Tworzymy bazę danych…

postgresql

//instalacja
sudoapt-getinstall postgresql postgresql-client postgresql-contrib
//zmiana hasla do bazdy danych
sudosu postgres -c psql
postgres=# ALTER USER postgres WITH PASSWORD 'hasło';
postgres=# \q
//usuniecie hasla dla uzytkownika
sudopasswd-d postgres
//dodanie hasla dla uzytkownika
sudosu postgres -cpasswd

build-essential apache2-prefork-dev

apt-get install build-essential apache2-prefork-dev

apache2

apt-get install apache2

adduser

sudo adduser USER_NAME

mc install

apt-get install mc

Ubuntu Skype Problem with Audio Playback

killall pulseaudiosudo apt-get remove pulseaudiosudo apt-get install esoundsudo rm /etc/X11/Xsession.d/70pulseaudio

graficzne statystyki

Using JFreeChart with Seam can be quite useful: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.
}
}In your JSF page:<
s:graphicImage value="#{chartprocesser.chart…