сряда, 31 декември 2008 г.

ATI Drivers Slackware

Download drv from ATI AMD page

untar
NAME --extract NewDirectory

get Patch:
ati_to_gpl.patch
from: ???
" Source of patch
#!/bin/sh
sed -i /MODULE_LICENSE\(/'s/".*"/"GPL"/' firegl_public.c
"
go to :
./NewDirectory/common/lib/modules/fglrx/build_mod/
!apply patch here!

Go to New Directory
ati-installer.sh 8.11 Slackware/All
! 8.11 - is driver version
in parent directory will be created two packages:
fglrx-module-8.552-x86-1_kernel_2.6.28.tgz
fglrx-x710-8.552-x86-1.tgz

upgradepkg --install-new ... # for them

!!! IF use once driver and change kernel Version DELETE this directory and extract again, because of internal links that is created to old kernel!!!

If fglrx apps crash with drivers 9.2 version need to check old files position and delete by hand old ati libs. Usually in /usr/lib/xorg/*/* and links too. /usr/lib/.

понеделник, 15 декември 2008 г.

simple rsync with ssh rsyncd.conf

Right synt is:

rsync -av --rsh="ssh" *.* sshuser at host.com:/full_path

--safe-links - do not follow links otside copied tree


/etc/rsyncd.conf:
motd file = /etc/motd
max connections = 25
syslog facility = local3

# rsync -a rbm.myftp.org::backup /root/routers/backups/rbm/ >/dev/null 2>&1
# RSYNC_PASSWORD=userpass rsync -a user@host.mine.com::backup /local dir/

[backup]
comment = Backup area
path = /backup
read only = yes
list = yes
uid = nobody
gid = nobody
auth users = user
secrets file = /etc/rsyncd.secrets

/etc/rsyncd.secret
user:userpass

It's important:
chmod 600 /etc/rsyncd.secrets

KDE4 some short notes

1. When start new X App:

"Maximum number of clients reached"

Read by my lips carefully:
/etc/rc.d/rc.messagebus stop - for slack rc.dbus
/etc/rc.d/rc.hald stop
rm /var/run/dbus/system_bus_socket
/etc/rc.d/rc.messagebus start
/etc/rc.d/rc.hald start

If under KDE or X env must restart them some future is broken because dbus-daemon socket change ???
try:
lshal
dbus-monitor


skype - Stupid Pyhon
ps ax | grep python
No need to kill will end alone when see that is not an loptop if it is not:
4177 ? S 0:00 /usr/bin/python /usr/bin/guidance-power-manager
kill 4177 - change PID

And all will be ok

2. Your USB keyboard is repeat pressed key very often and unnecessarily - my Logitech mx5000 have this problem and many other...

Go in System Settings - Keyboard - Enable Keyboard repeat - Disable or change Delay to Higher Value.

3. For GTK app use: lxappearance - to change Theme, Icons, fonts.

неделя, 14 декември 2008 г.

slackware mkinitrd

mkinitrd - no big deal

!!! All options must be supplied, because mkinitrd change on the fly when create initrd image !!!

mkinitrd - first time to create tree

mkinitrd -c -L -f ext3 -r /dev/mapper/Sea1t-root -k 2.6.27 -k 2.6.27 -m ext3 - for My with LVM2

-c - remove old initrd
-L - LVM support - copy some LVM commands
-f - type of Root FS - look carefully for EXT3 some times mkfs do not create journal must be made on hand tune2fs -j /dev/... . This will brooke initrd if it's for root or other auto mount part.
-r - which part to use for rootfs only /dev/mapper/... is right
-k - load modules from /lib/modules/supplied by You argument - VERSION HERE/... !!! - if not supplied
-m - initrd try to load modules

mkinitrd get 'uname -r' which is wrong in most cases !!!

OPTIOPNS:
1. cat initrd /init to see for changes:
mount -o ro /dev/' Your root' /mnt
exit

This will boot Your System in not very proper way if something is wrong with initrd, and you stuck in prompt inside initrd.

2. initrd - can be chaged ot Fly with boot Live CD.

-See Blog for - Grub install and

- use:
mkdir 'some dir'
cd 'some dir'
gzip 'initrd image.gz'
cpio -id < 'initrd image'


This will unshrink image, edit
!!! mkinitrd ... with all options


!!! After many try i figured out that SELinux troubling boot with:
these Errors :

"Can't execute /bin/init"


"linux failed to execute /init"


"No init found"


and some strange errors like module for fs of main partitition isn't compiled in kernel.
!!!
DISABLE : Security options -> Enable different security models - or try SELinux :)

grub install

Инсталиране на груб - проблемни ситуации

If get "Grub Hard Disk Error" most times problem is

From - info grub - Native install

in command prompt start: Personaly i use SLAX Live CD
- boot
- mount root part somewhere
- "chroot"
- mount all include boot if use separated part.
after that install grub:

grub

root (hd0,0) - for disk 0, part 1
find /boot/grub/stage1 - this not only show part with grub but get new PATH for GRUB ROOT with menu stages and etc...
setup (hd0) - This command will install the GRUB boot loader on the Master Boot
or
setup (hd0,0) - If you install GRUB into a partition or a drive other than the first one, you must chain-load GRUB from another boot loader. Refer to the manual for the boot loader to know how to chain-load GRUB.

P.S.
http://grub.enbug.org/LVMandRAID
GRUB has support for LVM and RAID since version 1.95
insmod lvm
insmod raid
grub-mkimage --output=/boot/grub/core.img ext2 pc gpt biosdisk lvm

LILO support boot from LVM


понеделник, 8 декември 2008 г.

Test HTTPS https

Test HTTPS
openssl s_client -no_tls1 -no_ssl3 -connect www.google.com:443



http://www.owasp.org/index.php/Testing_for_SSL-TLS

неделя, 7 декември 2008 г.

mplayer HD video on smaller screen no lag play without problems

- get latest svn
- recompile
This is close to 20G HD Movie

mplayer /mnt/hd/1/Troy.DC.2004.HDDVD.1080p.DTS.x264.dxva-EuReKa/3.\ Movie/Troy.DC.2004.HDDVD.1080p.DTS.x264.dxva-EuReKa.mkv -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all

-vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all

- some body of MPLayer TEAM made it show.

вторник, 2 декември 2008 г.

VI help

%s/foo/bar/g go through all the file and replace foo by bar :12,20s/foo/bar/ from line 12 to 20 replace foo for bar :s/foo/bar/g in the current line replace foo for bar the g after the last / means to replace all the occurrences of foo vby bar and not only the first one.


The one I find really useful is .,+20s/foo/bar/g

Replace all occurrences in the next 20 lines from the current line only. Great when your editing code and you've realised you used the wrong variable name in that method for example.


  1. ^V for block select
  2. Select the lines you want (10j for the next 10 lines)
  3. I for insert mode
  4. Type the # or whatever you want to prefix

Use visual mode (shift-v) to highlight lines, then shell out to external programs to filter them, such as perltidy. To do that, with lines highlighted, type !perltidy (assuming you have it on your machine). This lets you filter specific lines instead of the whole file.

Not horribly exciting ones, but useful:

xp - reverse next two characters
dL - Delete to end of page, in other words, everything visible.
C - Often overlooked: chop off end of line and go into insert mode.

:ret over highlighted text will reformat using the tabbing rules set up in your
.vimrc files. Quite handy when you have legacy code and new code mixed together leaving a big mess when opened in a viewer with different settings.
And, to remove the ^M from files that came from windows:
:se ff=unix

Am I just a vim noob? After doing a search and loving the nice highlighting, is there a way to unhighlight the search term without doing a "/lkasjdfkjdfdf"? In less(1), you'd hit u but haven't found anything for vim.

The tricks I use in vi/vim are mostly the arcane flags.

:set nows

will not search past the top or bottom.

:set sw=4

will make a nice indentation shiftwidth, especially for using the indent command (>). Works great for programming, especially with autoindent (:set ai). But when programming with autoindent, you often need to unindent one shiftwidth... do that by typing control-D at the beginning of the line. You can go to the very beginning of an autoindented line with 0 control-D.

:set list
:set nolist

will turn on/off hidden characters, and show end of lines. Great for finding tabs or spaces at the end of a line.

:set nu

will turn on line numbering.

Of course, if you want actual line numbers in your file, in *nix you'd use
:%!cat -n

%

when pressed over a parenthesis, finds the matching parenthesis or brackets

Now, I want someone to write a lisp interpreter based in vi macros. That way we can port emacs to vi.


move up to the top line of the block to be delete

mm (sets a marker "m")

move down to the last line in the block

d`m (deletes to marker "m", and that's the grave below the tilde, not the back-quote)

Ah, add "set compatible" to your .vimrc file and you have 99% vi behavior.

Also, you can do use "ma" to mark the beginning line, "mb" to mark the ending line, and then:

:'a,'bs/FROM/TO/g


(in vim only), Ctrl-A and Ctrl-X [vim.org] find the next number on the line starting at the cursor, and then increment or decrement it respectively.

Apart from being weird, these are surprisingly useful sometimes, e.g. toggling "#if 0" to "#if 1"...



Very cool. I didn't know how to mark a range like that before.

And, while we're having fun with search and replace, ^ will match the beginning of a line, so if you mark as above, and then change the command to: :'a,'bs/^/#/

you will have commented out a section of your code without having to insert a comment character independently on each line.
Reverse it with: :'a,'bs/^#//

to remove the comments.

Also, you don't have to use the / command as a separator. Anything typed after s will become the separator, so if you want to, say, change all your Windows paths to Unix paths, instead of starting with: :%s/\\/\//g

which, while undeniably cool, can be more easily written as: :%s;\\;/;g

which is a little easier to read.

Two other interesting bits:

u all by itself will undo the last command. Handy when you're testing your commands before posting them to Slashdot.

Also, Slashdot's editor will remove the newlines before any line that starts with a :
In my examples, I put each command on it's own line, but Slashdot keeps appending them to the previous line. Weird.



And if you add a c (confirm) to the end

:'a,'bs/FROM/TO/gc

you will get a Y/N to replace that instance or not, in case you don't want to replace every occurrence. if you search like this :'a,'b g/FINDME/ s/FROM/TO/gc

vi will ask for confirmation to replace FROM to TO only on line between a and b markers on lines with the string FINDME on it.

:.,$ g/FINDME/p will search from your current cursor position (.) to the end of the document ($) and get /regular expression/ print (i.e grep) inside of vi.

456G

go to the 456 line (G for the last line)

These are a few of my favourite things. Vi plugin for Eclipse and Visual Studio actually makes them have a worthwhile editor, I couldn't imagine not having all the effort I invested into using vi available in some of the "editors" available today.


By Mi
On some Line just type any number let say 8:
- If press ENTER go 8 Lines Below
- if Press SPACE go 8 symbols ahead
- ? what will do with - in front :)


събота, 29 ноември 2008 г.

tricks man find

from: http://linux-blog.org/

I wanted a quick way to be able to find out what files weren’t visible to others (and therefore, not visible to website visitors). Messing with arguments and the file command, you can do the following:
find -type f ! -perm -444

This locates all files not visible to ‘others’ in the current directory. You can apply this to directories as well:
find -type d ! -perm -111

This allows you to quickly display the 96th line of filename.php. Hope this helps someone like it has me.

head -n 96 filename.php | tail -n 1

Ever wonder how you can get a man page in into a format you can read
and print? There’s many methods of doing it (copy and paste is one) but
one the easiest I’ve found is:

man command | col -x -b > command.txt


slow laggy GTK under slackware KDE4

Just change fonts from System Config

- Resize speed will be good like under Gnome
- Firefox Auto-Scroll stay laggy
- After some play with resize becom laggy again ???

- If have trouble with outlook gtk Theme
use lxappearance - compile, run, choose Theme Icons and Save
the resul is seen imediatly

gtkperf -a -c 1000

A little update if somebody read this please publish your results!
Test rounds: 100
GtkPerf 0.40 - Starting testing: Sat Feb 7 09:10:59 2009

GtkEntry - time: 0,03
GtkComboBox - time: 3,21
GtkComboBoxEntry - time: 3,21
GtkSpinButton - time: 0,17
GtkProgressBar - time: 0,11
GtkToggleButton - time: 0,32
GtkCheckButton - time: 0,22
GtkRadioButton - time: 0,23
GtkTextView - Add text - time: 0,71
GtkTextView - Scroll - time: 0,79
GtkDrawingArea - Lines - time: 1,53
GtkDrawingArea - Circles - time: 28,29
GtkDrawingArea - Text - time: 10,95
GtkDrawingArea - Pixbufs - time: 0,62
---
Total time: 50,40

Test rounds: 1000
GtkPerf 0.40 - Starting testing: Sat Feb 7 09:17:01 2009

GtkEntry - time: 0,41
GtkComboBox - time: 31,98
GtkComboBoxEntry - time: 31,41
GtkSpinButton - time: 0,95
GtkProgressBar - time: 0,54
GtkToggleButton - time: 2,94
GtkCheckButton - time: 1,64
GtkRadioButton - time: 2,22
GtkTextView - Add text - time: 40,90
GtkTextView - Scroll - time: 44,78
GtkDrawingArea - Lines - time: 14,31
GtkDrawingArea - Circles - time: 169,86
GtkDrawingArea - Text - time: 105,87
GtkDrawingArea - Pixbufs - time: 4,45
---
Total time: 452,24

A link for other results: http://gtkperf.sourceforge.net/gtkperftesting_06022005.txt
No good thing for me.