2009. július 25., szombat

Mysql lock tables

Időnként Excel kimutatással érek el MySql táblákat, viszont volt egy olyan problémám, hogy ha épp frissítettem egy táblát (truncate, load into ...), akkor is frissíthettem a kimutatást, de így sajnos rossz (félig kész) adatokat mutatott.

Eme problémát megelőzendő próbálkoztam a lock tables paranccsal.

Elsőre a "lock tables táblanév read;" paranccsal kísérleteztem, de mint kiderült a write a helyes irány:

LOCK TABLES táblanév WRITE;

Ja, tapasztalatom szerint a LOCK TABLES parancsot TRUNCATE parancs után kell kiadni!
Ezen parancs hatása alatt az Excel nem tud kimutatást frissíteni, csak homokórázik.

Amint kiadom a feloldás parancsot, a kimutatás újra frissíthető:

UNLOCK TABLES;


Forrás:
http://hup.hu/node/73927
http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

2009. július 21., kedd

Legfrissebb fájl másolása

Szükségem volt egy olyan scriptre, amely a legfrissebb fájlt átmásolja úgy, hogy a cél egy fix fájlnév legyen (Windows XP alatt).

cd "target_dir"
FOR /F "delims=|" %%I IN ('DIR "*.BAK" /B /O:D') DO SET NewestFile=%%I
echo %NewestFile% > legujabb.txt
copy /Y %NewestFile% legujabb.BAK2

DIR parancs kapcsolói:
/B: Egyszerű formátum (nincs fejléc-információ és összegzés)
/O:D Sorbarendezés dátum szerint (régiektől)

2009. július 20., hétfő

Aix smit.log file

Aix alatt a smit segédprogram log fájljából sok hasznos információt kinyerhetünk.

smit.log helye: /smit.log

Stop a Print Queue
/usr/bin/enq -D -P 'scabc:@scabc'

Start a Print Queue
/usr/bin/enq -U -P 'scabc:@scabc'

-D
Device DOWN. Turns off the device associated with the queue.
-P Queue
Specifies the queue to which the job is sent. A particular device
on a queue can be specified by typing -P Queue:Device.
-U
Brings UP the device associated with a queue.

Ingyenes CMS rendszerek

Ma már rengeteg ingyenes és kiváló CMS rendszert tölthetünk le.

Jó kiinduló pont ezek teszteléséhez az opensourceCMS.com.
Kategóriákban böngészhetünk és online demo is elérhető.

A CMS Matrix honlapon pedig rengeteg szempont hasonlíthatjuk össze a CMS rendszereket.

Néhány freeware program

Íme néhány általam kedvelt freeware program:

SpeedFan
Az alaplap, a processzor, a merevlemez és a videokártya hőmérsékletét figyeli az ingyenes program. Támogatja a S.M.A.R.T. technológiát, alkalmas a hőmérsékletek grafikus kijelzésre.

musikCube
A musikCube egy nyílt forráskódú zenei lejátszó nagyszerű zenetárral.
Az ingyenes, nyílt forráskódú musikCube MP3, OGG, FLAC, APE és CD-Audio formátumokat is támogat. CD-ripper és LAME-MP3, OGG és FLAC kodekeket szintén tartalmaz. Az ablakot saját kedvünk szerint állíthatjuk be, és rengeteg plug-in is letölthető a programhoz, például a gyártó oldaláról. Figyeltethetjük egy könyvtár tartalmát és kollekciókat készíthetünk, amelyből kiválogathatjuk (Ctrl+egér) a megfelelő előadókat vagy albumokat. Netrádiókat is kezel.

prime95
Új prímszámok számolásával a rendszerállapot felmérését végző program.
Nálam pl. eme teszt szinte rögtön lefagyasztotta a gépem, jelezve, hogy valami probléma van a gépem terhelhetőségével (ezt sajnos tapasztaltam is).

2009. július 17., péntek

Linux script (Escapes in Regular Expressions)

GNU Extensions for Escapes in Regular Expressions

The list of these escapes is:

\a
Produces or matches a bel character, that is an “alert” (ascii 7).
\f
Produces or matches a form feed (ascii 12).
\n
Produces or matches a newline (ascii 10).
\r
Produces or matches a carriage return (ascii 13).
\t
Produces or matches a horizontal tab (ascii 9).
\v
Produces or matches a so called “vertical tab” (ascii 11).
\cx
Produces or matches Control-x, where x is any character. The precise effect of `\cx' is as follows: if x is a lower case letter, it is converted to upper case. Then bit 6 of the character (hex 40) is inverted. Thus `\cz' becomes hex 1A, but `\c{' becomes hex 3B, while `\c;' becomes hex 7B.
\dxxx
Produces or matches a character whose decimal ascii value is xxx.
\oxxx
Produces or matches a character whose octal ascii value is xxx.
\xxx
Produces or matches a character whose hexadecimal ascii value is xx.

`\b' (backspace) was omitted because of the conflict with the existing “word boundary” meaning.

Other escapes match a particular character class and are valid only in regular expressions:

\w
Matches any “word” character. A “word” character is any letter or digit or the underscore character.
\W
Matches any “non-word” character.
\b
Matches a word boundary; that is it matches if the character to the left is a “word” character and the character to the right is a “non-word” character, or vice-versa.
\B
Matches everywhere but on a word boundary; that is it matches if the character to the left and the character to the right are either both “word” characters or both “non-word” characters.
\`
Matches only at the start of pattern space. This is different from ^ in multi-line mode.
\'
Matches only at the end of pattern space. This is different from $ in multi-line mode.

2009. július 14., kedd

rsync parancsról röviden

Telepítve van-e:
# dpkg --get-selections | grep rsync

----------------------------------------------------

rsync telepítése:
# apt-get update
# apt-get install rsync

----------------------------------------------------

rsync konfiguráció:

/etc/rsyncd.conf

uid=0
gid=0
read only = yes
use chroot = no
auth users = backup
hosts allow = 192.168.111.111
hosts deny = *
secrets file = /etc/rsync.secret

[mind]
path = /
exclude = /dev /initrd /lost+found /media /mnt /opt /proc /selinux /sys /tmp

Jogok beállítása:
/etc/rsync, /etc/rsyncd
640

Futtatás másként parancssorból

Windows XP, Vista alatt van egy érdekes parancs: runas
Ezen parancs segítségével az aktuális felhasználótól eltérő user nevében lehet futtatni parancsot (nem kell átjelentkezni)

Példák:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

A runas parancs érdekes alternatívája a cpau freeware program.
Ezzel job-okat hozhatunk létre, kódolhatjuk a jelszót, stb.:
Command line tool for starting process in alternate security context. Basically this is a runas replacement. Also allows you to create job files and encode the id, password, and command line in a file so it can be used by normal users.

2009. július 10., péntek

Kedvenc letöltési helyeim

Íme néhány hely, amit gyakran meglátogatok,
ha keresek valamilyen (ingyenes) programot:

Chip
FreewareFiles.com
Freshmeat.net
Snapfiles.com
SourceForge.net

Radio Sure: Kedvenc freeware online rádiólejátszó

Radio Sure

Egyszerű, gyors kis lejátszó és ráadásul még képes felvenni is a számokat.

Ma épp 122 db magyar adást ismert (hungarian szóra keresve).

Kedvenc magyar állomások:
- Danubius,
- Fehérvár,
- Juventus,
- Mellesleg Rádió Humor/kabaré
- Slager rádió

- More than 12000 of stations in the package
- Supports most of the internet radio formats - mp3, wma, ogg vorbis, aac+ and so on
- Quick and reliable search for your favorite radio stations
- Smooth switching between stations including crossfade effect
- Recording what you are listening to and packaging it into separate song files
- Simultanious recording of multiple stations
- Automatic checking for software and radio stations updates
- Command line parametes for automatization
- Runs on Windows XP and Vista 32 and 64 bit
- UNICODE support - all domestic stations are perfectly visible and searchable

Online víruskeresés

A VirusTotal egy olyan ingyenes szolgáltatás, amellyel számos antivírus motor segítségével gyanús állományokat elemezhetünk:

VirusTotal.com

Ezen gyártók antivirus motorjai vizsgálják a feltöltött állományokat:

AhnLab (V3)
Antiy Labs (Antiy-AVL)
Aladdin (eSafe)
ALWIL (Avast! Antivirus)
Authentium (Command Antivirus)
AVG Technologies (AVG)
Avira (AntiVir)
Cat Computer Services (Quick Heal)
ClamAV (ClamAV)
Comodo (Comodo)
CA Inc. (Vet)
Doctor Web, Ltd. (DrWeb)
Emsi Software GmbH (a-squared)
Eset Software (ESET NOD32)
Fortinet (Fortinet)
FRISK Software (F-Prot)
F-Secure (F-Secure)
G DATA Software (GData)
Hacksoft (The Hacker)
Hauri (ViRobot)
Ikarus Software (Ikarus)
INCA Internet (nProtect)
K7 Computing (K7AntiVirus)
Kaspersky Lab (AVP)
McAfee (VirusScan)
Microsoft (Malware Protection)
Norman (Norman Antivirus)
Panda Security (Panda Platinum)
PC Tools (PCTools)
Prevx (Prevx1)
Rising Antivirus (Rising)
Secure Computing (SecureWeb)
BitDefender GmbH (BitDefender)
Sophos (SAV) Sunbelt Software (Antivirus)
Symantec (Norton Antivirus)
VirusBlokAda (VBA32)
Trend Micro (TrendMicro)
VirusBuster (VirusBuster)

2009. július 7., kedd

Processzor fagyása ellen hővezető zsír

Hosszú ideig fagyott a processzorom, főleg nagy gyári melegben és/vagy nagyobb terhelésnél. A probléma már nagyon idegesített, ezért egy jól képzett informatikushoz fordultam, akinek volt egy jó tippje: hővezető zsír.

- Lekapartuk a hővezető zsírt a CPU és a ventillátor-hűtőborda felületéről
- Újrakentük a hővezető zsírt
- Láss csodát, azóta a gépem nem fagy, bírja a terhelést :-)

Az eredeti hővezető párnára nem szabad további hővezető zsírt vagy pasztát kenni. Ha mégis szükség lenne rá, akkor vegye le a ventillátor-hutobordát a processzorról, és visszahelyezés elott ellenőrizze, hogy a hővezető anyag használható-e még! Ha a TIM zavaros, javasoljuk, hogy töröljön le minden maradványt a CPU és a ventilátor-hutoborda felületérol egy pihementes ronggyal (pl. Kimwipes-szal), és tegyen fel egy új hovezeto párnát

Youtube: Installing a Processor and Heatsink