- download Oracle JRE tarball from Oracle Java SE Downloads
- make dir/copy to/cd to for java:
mkdir -p /usr/java/latest && cp ./jre* /usr/java/latest && cd /usr/java/latest - unpack: tar zxvf jre*
- setup alternatives:
update-alternatives --install "/usr/bin/java" "java" "/usr/java/latest/jre1.7.0_<version>/bin/java" 1 - setup this java version active:
update-alternatives --set java /usr/java/latest/jre1.7.0_<version>/bin/java - check it:
java -version - PROFIT!!1!11
четверг, 16 января 2014 г.
[Linux] Setting up Oracle JRE on linux system
вторник, 24 декабря 2013 г.
Installing ejabberd from sources
dpkg -i erlang-solutions_1.0_all.deb
apt-get update
apt-get install make gcc git libyaml-dev libexpat1-dev libssl erlang
git clone https://github.com/processone/ejabberd
cd ejabberd
./configure --enable-odbc
make
make install
These commands will:
- Install the configuration files in /etc/ejabberd/
- Install ejabberd binary, header and runtime files in /lib/ejabberd/
- Install the administration script: /sbin/ejabberdctl
- Install ejabberd documentation in /share/doc/ejabberd/
- Create a spool directory: /var/lib/ejabberd/
- Create a directory for log files: /var/log/ejabberd/
понедельник, 9 декабря 2013 г.
Clock in console
while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
вторник, 22 октября 2013 г.
Virtual Box Console commands
As something of a follow-up post to the previous entry, here’s a quick recipe for creating a Virtual Machine using the VirtualBox command line tools:
We’re using Windows Server 2008 64bit as an example, modify to taste.
$ VM='Windows-2008-64bit'
Create a 32GB “dynamic” disk.
$ VBoxManage createhd --filename $VM.vdi --size 32768
You can get a list of the OS types VirtualBox recognises using:
$ VBoxManage list ostypes
Then copy the most appropriate one into here.
$ VBoxManage createvm --name $VM --ostype "Windows2008_64" --register
Add a SATA controller with the dynamic disk attached.
$ VBoxManage storagectl $VM --name "SATA Controller" --add sata \
> --controller IntelAHCI
$ VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 \
> --device 0 --type hdd --medium $VM.vdi
Add an IDE controller with a DVD drive attached, and the install ISO inserted into the drive:
$ VBoxManage storagectl $VM --name "IDE Controller" --add ide
$ VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 \
> --device 0 --type dvddrive --medium /path/to/windows_server_2008.iso
Misc system settings.
$ VBoxManage modifyvm $VM --ioapic on
$ VBoxManage modifyvm $VM --boot1 dvd --boot2 disk --boot3 none --boot4 none
$ VBoxManage modifyvm $VM --memory 1024 --vram 128
$ VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 e1000g0
Configuration is all done, boot it up! If you’ve done this one a remote machine, you can RDP to the console via vboxhost:3389
.
$ VBoxHeadless -s $VM
Once you have configured the operating system, you can shutdown and eject the DVD.
$ VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 \
> --device 0 --type dvddrive --medium none
Finally, it’s a good idea to take regular snapshots so that you can always revert back to a known-good state rather than having to completely re-install.
$ VBoxManage snapshot $VM take <name of snapshot>
And, if you need to revert back to a particular snapshot:
$ VBoxManage snapshot $VM restore <name of snapshot>
Enjoy!
Readline shortcuts
Readline shortcuts
GNU Readline is the library used to make advanced command-line wizardry convenient and conistent across a multitude of command-line applications. These programs include bash, bc, ftp, gnuplot, gpg, ksh, mysql, psql, python, smbclient, xmllint and zsh.The cheatsheet at the right contains a summary of many of the useful line editing command shortcuts which are available in all applications that use libreadline.
See the documentation on the Readline website for even more shortcuts with more elaborate descriptions.
Emacs keys | Action | Scope | Direction/Place | |
---|---|---|---|---|
Moving around | Ctrl-b | Move the cursor | one character | ⇦ to the left |
Ctrl-f | Move the cursor | one character | ⇨ to the right | |
Alt-b | Move the cursor | one word | ⇦ to the left | |
Alt-f | Move the cursor | one word | ⇨ to the right | |
Ctrl-a | Move the cursor | ⇤ to the start of the line | ||
Ctrl-e | Move the cursor | ⇥ to the end of the line | ||
Ctrl-x-x[1] | Move the cursor | ⇤⇥ to the start, and to the end again | ||
Cut, copy and paste |
Backspace | Delete | the character | ⇦ to the left of the cursor |
DEL Ctrl-d |
Delete | the character | underneath the cursor | |
Ctrl-u | Delete | everything | ⇤ from the cursor back to the line start | |
Ctrl-k | Delete | everything | ⇥ from the cursor to the end of the line | |
Alt-d | Delete | word | ⇨ untill before the next word boundary | |
Ctrl-w | Delete | word | ⇦ untill after the previous word boundary | |
Ctrl-y | Yank/Paste | prev. killed text | at the cursor position | |
Alt-y | Yank/Paste | prev. prev. killed text | at the cursor position | |
History | Ctrl-p | Move in history | one line | ⇧ before this line |
Ctrl-n | Move in history | one line | ⇩ after this line | |
Alt-> | Move in history | all the lines | ⇩ to the line currently being entered | |
Ctrl-r | Incrementally search the line history | ⇧ backwardly | ||
Ctrl-s[2] | Incrementally search the line history | ⇩ forwardly | ||
Ctrl-J | End an incremental search | |||
Ctrl-G | Abort an incremental search and restore the original line | |||
Alt-Ctrl-y | Yank/Paste | arg. 1 of prev. cmnd | at the cursor position | |
Alt-. Alt-_ |
Yank/Paste | last arg of prev. cmnd | at the cursor position | |
Undo | Ctrl-_ Ctrl-x Ctrl-u |
Undo the last editing command; you can undo all the way back to an empty line | ||
Alt-r | Undo all changes made to this line | |||
Ctrl-l | Clear the screen, reprinting the current line at the top | |||
Ctrl-l | Clear the screen, reprinting the current line at the top | |||
Completion | TAB | Auto-complete a name | ||
Alt-/[3] | Auto-complete a name (without smart completion) | |||
Alt-? | List the possible completions of the preceeding text | |||
Alt-* | Insert all possible completions of the preceeding text | |||
Transpose | Ctrl-t | Transpose/drag | char. before the cursor | ↷ over the character at the cursor |
Alt-t | Transpose/drag | word before the cursor | ↷ over the word at/after the cursor |
вторник, 8 октября 2013 г.
Installing b43 wireless on ubuntu
http://downloads.openwrt.org/sources/wl_apsta-3.130.20.0.o
and
http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
Copy them into your installation flashdrive
Install b43-fwcutter from /cdrom/pool/main/b/ there will be .deb package
Than:
tar -xjvf broadcom-wl-4.150.10.5.tar.bz2
sudo b43-fwcutter -w /lib/firmware wl_apsta-3.130.20.0.o
sudo b43-fwcutter --unsupported -w /lib/firmware broadcom-wl-4.150.10.5/driver/wl_apsta/wl_prebuilt.o
sudo chmod 775 /lib/firmware/b43
sudo chmod 775 /lib/firmware/b43legacy
sudo modprobe -r b43
sudo modprobe b43
Thats it :) Works on Ubuntu 13.04
пятница, 4 октября 2013 г.
Sphinx on Gentoo
emerge --sync
emerge portage
# Установить sphinx
USE="debug id64 mysql -postgres stemmer test" emerge app-misc/sphinx
# Скопировать или переименовать конфигурационный файл
cd /etc/sphinx
cp sphinx.conf.dist sphinx.conf
# Настроить разрешения, чтоб группа web могла редактировать конфигурационный файл
chmod 664 /etc/sphinx/*
chown root:web /etc/sphinx/*
# Добавить пользователя и группу sphinx
groupadd -g 494 sphinx
useradd -g sphinx -u 494 -d /var/lib/sphinx -s /bin/bash -c "Sphinx server" sphinx
# Создать папки, где будут храниться логи, pid-файлы и данные
mkdir -p /var/log/sphinx
mkdir -p /var/run/sphinx
mkdir -p /var/lib/sphinx/data
# Настроить правильные разрешения на эти папки
chown sphinx:sphinx /var/log/sphinx
chown -R sphinx:sphinx /var/lib/sphinx
chown sphinx:sphinx /var/run/sphinx
# Добавить в /etc/sudoers что-то типа
%web ALL=NOPASSWD:/etc/init.d/searchd
%web ALL=(sphinx) NOPASSWD:/usr/bin/indexer
# Проверить от пользователя группы web
sudo -u sphinx /usr/bin/indexer
sudo /etc/init.d/searchd restart|stop|start
# Установить расширения php
PHP_TARGETS="php5-4" emerge pecl-sphinx
Так же пришлось немного подправить init скрипт, чтобы запускать свинкс от моего пользователя