工做中用到的技術小常識


將數據導出 java

SELECT * FROM 表名limit 10000 into outfile '/tmp/dgguanwang1019.txt' fields terminated by " "

"mysql -u**** -p**** -e 'SELECT * FROM sdfdsf where username = wewefef' db>1.sql"

----------------判斷當前頁面是否包含在iframe中,如是從新加載當前頁面---------------------
//iframe包含
if (top.location != location) {
 top.location.href = location.href;
}
-----------------在文件每行後面追加新內容(linux)---------------------------------------------------
 sed 's/$/要替換成的內容/' card.txt

--------------------------------------------------
爲指定數據庫添加用戶
GRANT all ON 數據庫名.* to 用戶名@localhost identified by '密碼'
添加好用:flush privileges;
grant all on webgame.* to cxuser@localhost identified by '123456';
update user set password = password('123456!') where user='cxuser';
flush privileges;

--------------about cookie-------------------
6)有多條cookie.setPath("XXX");語句的時候,起做用的以最後一條爲準。

-----------------------ssh 鏈接-------------------------------
 ssh 用戶名@ip -p 40022

--------------------------eclipse 開發插件------------------------------
egit - http://download.eclipse.org/egit/updates
-----------------------------建立一個git項目,在服務器端----------------------------------------------------
cd /home/git/
mkdir project_name.git
cd project_name.git
git --bare init
cd ..
chown -R git:git project.git
------------------------------------從模板表建立表---------------------------------------------
create table if not exists table_name like old_table_name;

------------------MySql中怎樣判斷某個字段的值是否是中文字符----------------
select * from table_name where col_name not regexp "[\u0391-\uFFE5]"
PS:[\u0391-\uFFE5] 包括的範圍不單單是中文

[\\u0391-\\uFFE5]匹配雙字節字符(漢字+符號)
能夠參考 http://zhangfeiii.javaeye.com/blog/504893
---------------------Linux 批量替換------------------------------------------------------
sed -i "s/oldString/newString/g" /data/www/
將/data/www/目錄下的 old字符串所有替換爲newString
-------------------------------------------------------------------------------------------
service sshd restart 重啓ssh
開啓ssh認證,取消文件內如下注釋
/etc/ssh/sshd_config
***
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
***
---------------------------------------------------------------------------------------
服務器已啓用ssh
添加新用戶(git),鏈接無效
緣由,目錄權限不對,
須要將/home/git目錄的權限修改成700
-------------------------修改linux用戶uid了-----------------------------------
修改用戶ID
#usermod -u UID username
修改組ID
#groupmod -g GID groupname
--------------------rsync----------------------------------------
只同步指定目錄
 建文件,用來包含要同步的目錄:include.list
  rsync 使用 --files-from=‘include.list’
eg:
rsync -arpogvz --delete --password-file='/data/rsync.pwd' --files-from='/data/include.list' --exclude-from='/data/exclude.list' git@ip::xxxxx /data/www/
相關文章
相關標籤/搜索