mysql> create database user_name DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql> grant usage on *.* to user_name@localhost identified by 'user_pwd';
mysql> grant all privileges on user_name.* to user_name@localhost;
20110825
20110823
20110821
Bukkit Plugins, etc.
PermissionsBukkit (Official)
iConomy
BOSEconomy
Citizens (NPC) | wiki | 2
MobBounty
Essentials (no PermissionsBukkit support :( ) | Signs
iConomy
BOSEconomy
Citizens (NPC) | wiki | 2
MobBounty
Essentials (no PermissionsBukkit support :( ) | Signs
20110817
minecraft server
as daemon:
/etc/init.d/minecraft start
/etc/init.d/minecraft stop
/etc/init.d/minecraft restart
/etc/init.d/minecraft status
connect to terminal screen:
screen -r minecraft
disconnect from screen with:
Ctrl+A D
/etc/init.d/minecraft start
/etc/init.d/minecraft stop
/etc/init.d/minecraft restart
/etc/init.d/minecraft status
connect to terminal screen:
screen -r minecraft
disconnect from screen with:
Ctrl+A D
20110810
Android cheap phone
HTC Wildfire S
LMT (Cena Ls 19 + 6.00 * 24 mēn.) = 163Ls
LG Optimus One P500
LMT: (Cena Ls 9 + 4.00 * 24 mēn.) = 105Ls
Samsung Galaxy Ace
LMT: (Cena Ls 19 + 6.50 * 24 mēn.) = 175Ls
HTC Desire
LMT: (Cena Ls 29 + 8.50 * 24 mēn.) = 233Ls
LMT ar Formula 8:
Wildfire S: 163 + 192 = 355
P500: 105 + 192 = 297
Bite ar 3,5Ls pieslēgumu:
Wildfire S: 227 + 84 = 311
P500: 169 + 84 = 254
LMT (Cena Ls 19 + 6.00 * 24 mēn.) = 163Ls
LG Optimus One P500
LMT: (Cena Ls 9 + 4.00 * 24 mēn.) = 105Ls
Samsung Galaxy Ace
LMT: (Cena Ls 19 + 6.50 * 24 mēn.) = 175Ls
HTC Desire
LMT: (Cena Ls 29 + 8.50 * 24 mēn.) = 233Ls
LMT ar Formula 8:
Wildfire S: 163 + 192 = 355
P500: 105 + 192 = 297
Bite ar 3,5Ls pieslēgumu:
Wildfire S: 227 + 84 = 311
P500: 169 + 84 = 254
Etiķetes:
android
20110805
svn diff coloured (vim) + citi sīkumi
grep -rin 'text' ./ --include=*.php
find -name '*.php' -exec egrep -Hn 'SEARCHTERM' {} \;
find . -exec grep -H -n 'hello' {} \;
delete ALOT of logfiles:
find . -type f -name "*.log" -delete
treeview in console:
find . -type d -print | sed -e 's;[^/]*/;|__;g;s;____|; |;g'
http://www.zalas.eu/viewing-svn-diff-result-in-vim
P.S. SVN DIFF with previous version:
SVN PROPGET
svn proplist .
svn propget -R svn:ignore .
svn propedit svn:ignore .
SVN CACHE IGNORE (previously commited)
$ cd /path/to/cache/folder
$ svn stat
###bunch of M's...
$ svn rm * --keep-local
$ svn ci -m 'clearing cache'
$ svn propset svn:ignore '*' .
$ svn up
$ svn ci -m 'cache ignored'
P.S.S. Delete files like 'tmp_*' last accessed at least 2 days ago:
find . -name 'tmp_*' -atime +2 -exec rm {} \;
Number of files in directory:
ls | wc -l
Directory size:
du -hs
Check syntax errors in php script:
php -l ./script.php
TAB settings in Vim:
:set tabstop=4
:set shiftwidth=4
:set expandtab
:retab
Delete ALOT of files:
find /home/dir/ -name "*.tmp" | xargs /bin/rm
How to maintenance page:
http://www.techiecorner.com/97/redirect-to-maintenance-page-during-upgrade-using-htaccess/
mysqldump .. parameters.. | gzip > db_backupfile_tablename.sql.gz
quick dump - NB! could be inconsistent state:
mysqldump -h hostname -u username -ppassword --lock-tables=false --quick dbname | gzip > dbname.sql.gz
gunzip < dbname.sql.gz | mysql -h hostname -u username -ppassword dbname
select av.ModulID, GROUP_CONCAT(distinct av.ID order by av.ID SEPARATOR '&') as concatted from Lang l left join AttributeValue av on l.ID = av.LangID where TextKey like 'si_%' and l.ModulID = 21 group by av.ModulID;
select table_schema, (SUM(data_length) + SUM(index_length))/1048576 as size_in_MB from information_schema.tables where table_schema = 'db_name' group by table_schema;
select table_schema, table_name, (SUM(data_length) + SUM(index_length))/1048576 as size_in_MB from information_schema.tables where table_schema = 'db_name' group by table_schema, table_name;
create database dbname;
grant usage on *.* to dbuser@localhost identified by 'dbpass';
grant all privileges on dbname.* to dbuser@localhost;
Linux:
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld restart
OSX:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
sql injection: http://websec.ca/kb/sql_injection
http://vim.wikia.com/wiki/Search_and_replace
:highlight Comment ctermfg=green/blue/yellow
php style: http://pear.php.net/manual/en/standards.php
global search/replace with grep and sed:
grep -rl --include="*.php" "oldstring" . | xargs sed -i 's/oldstring/newstring/g'
find -name '*.php' -exec egrep -Hn 'SEARCHTERM' {} \;
find . -exec grep -H -n 'hello' {} \;
delete ALOT of logfiles:
find . -type f -name "*.log" -delete
treeview in console:
find . -type d -print | sed -e 's;[^/]*/;|__;g;s;____|; |;g'
svn diff file.ext | view -
http://www.zalas.eu/viewing-svn-diff-result-in-vim
P.S. SVN DIFF with previous version:
svn diff -r PREV file
svn diff -r HEAD:PREV file
SVN PROPGET
svn proplist .
svn propget -R svn:ignore .
svn propedit svn:ignore .
SVN CACHE IGNORE (previously commited)
$ cd /path/to/cache/folder
$ svn stat
###bunch of M's...
$ svn rm * --keep-local
$ svn ci -m 'clearing cache'
$ svn propset svn:ignore '*' .
$ svn up
$ svn ci -m 'cache ignored'
P.S.S. Delete files like 'tmp_*' last accessed at least 2 days ago:
find . -name 'tmp_*' -atime +2 -exec rm {} \;
Number of files in directory:
ls | wc -l
Directory size:
du -hs
Check syntax errors in php script:
php -l ./script.php
TAB settings in Vim:
:set tabstop=4
:set shiftwidth=4
:set expandtab
:retab
Delete ALOT of files:
find /home/dir/ -name "*.tmp" | xargs /bin/rm
How to maintenance page:
http://www.techiecorner.com/97/redirect-to-maintenance-page-during-upgrade-using-htaccess/
mysqldump .. parameters.. | gzip > db_backupfile_tablename.sql.gz
quick dump - NB! could be inconsistent state:
mysqldump -h hostname -u username -ppassword --lock-tables=false --quick dbname | gzip > dbname.sql.gz
gunzip < dbname.sql.gz | mysql -h hostname -u username -ppassword dbname
select av.ModulID, GROUP_CONCAT(distinct av.ID order by av.ID SEPARATOR '&') as concatted from Lang l left join AttributeValue av on l.ID = av.LangID where TextKey like 'si_%' and l.ModulID = 21 group by av.ModulID;
select table_schema, (SUM(data_length) + SUM(index_length))/1048576 as size_in_MB from information_schema.tables where table_schema = 'db_name' group by table_schema;
select table_schema, table_name, (SUM(data_length) + SUM(index_length))/1048576 as size_in_MB from information_schema.tables where table_schema = 'db_name' group by table_schema, table_name;
create database dbname;
grant usage on *.* to dbuser@localhost identified by 'dbpass';
grant all privileges on dbname.* to dbuser@localhost;
Linux:
/etc/init.d/mysqld start
/etc/init.d/mysqld stop
/etc/init.d/mysqld restart
OSX:
sudo /usr/local/mysql/support-files/mysql.server start
sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server restart
sql injection: http://websec.ca/kb/sql_injection
http://vim.wikia.com/wiki/Search_and_replace
:highlight Comment ctermfg=green/blue/yellow
php style: http://pear.php.net/manual/en/standards.php
global search/replace with grep and sed:
grep -rl --include="*.php" "oldstring" . | xargs sed -i 's/oldstring/newstring/g'
Abonēt:
Ziņas (Atom)