» 2013 » January の記事

當你用illustrator做完layout design 後會發現有好多link file 同埋fonts
你想比其他人改你個AI file 你需要抄晒所有linking file 同fonts
ArtFile 可以幫到你,ArtFIle 係Adobe Illustrator 既plug-in 可以做到export 所有file path

http://www.code-line.com/software/artfiles1/

vlcsnap-2013-01-25-10h53m18s211

非常清楚,可以turn page 

Screen Shot 2013-01-23 at 5.24.45 PM

http://www.flipbuilder.com/

~ install mcrypt in ubuntu ~

connie 2013.01.22 | ubuntu | | No Comments
apt-get install php5-mcrypt
/etc/init.d/apache2 restart

 

~ Warning: mysqli_connect(): (HY000/2002) ~

connie 2013.01.18 | php | | No Comments

如果php connect mysql 時出現以下情況

Warning: mysqli_connect(): (HY000/2002): 
No such file or directory in *****.php on line 8 
Warning: mysqli_query() expects parameter 1 to be mysqli, 
boolean given in *****.php on line 9 
Connect failed

只要將connect DB 由localhost 改回127.0.0.1 就可以了

define('DATABASE_SERVER', '127.0.0.1');

 

~ 延長phpmyadmin 的login session 時間 ~

connie 2013.01.10 | php | | No Comments

在config.inc.php 加上或修改以下coding

$cfg['LoginCookieValidity'] = 3600 * 9; // 9 hours

完成

~ use Find 來找linux 內的file ~

connie 2013.01.09 | Linux | | No Comments

linux command 搵folder 入面 jpg,png,gif 以外的files
假設要找尋的folder 為 /var/www 的所有file

find . ! -name '*.jpg' ! -name '*.png' ! -name '*.gif'

 

10.7後,MAC OSX 加入新功能,可以restore 返你關機前既狀態

小妹通常一開就開一大堆program的,aperture, photoshop , ai , eclipse , 總之開得就開

問題就尼了,一重新開機,等到微笑。

終於找到可以停止restore 動作。

先去system preference> General 

Screen Shot 2013-02-03 at 11.11.27 PM

untick "Restore windows when qutting and re-opening apps , 之後就可以重新開機而不restore apps

~ Mysql 取出任意3天的record ~

connie 2013.01.07 | mysql | | No Comments
SELECT `accountname` FROM `tablename` 
where `log_date`>'2012-12-30 00:00:00' 
and `log_date`<'2013-01-03 23:59:59' 
group by `log_date`,`accountname` 
having COUNT(DISTINCT date(log_date));

 

~ 列出連續5天有紀錄 ~

connie 2013.01.06 | mysql | | No Comments

先要create function

DELIMITER //
CREATE FUNCTION bits_find_N1(bits BIGINT, trait BIGINT)
  RETURNS BOOL
  BEGIN
    WHILE bits <> 0 DO
      IF ((bits & trait) = trait) THEN
        RETURN TRUE;
      END IF;
      SET bits = bits >> 1;
    END WHILE;
    RETURN FALSE;
  END//
  DELIMITER ;

mysql statement

SELECT accountname AS bit FROM tablename
WHERE log_date BETWEEN '2012-12-30 00:00:00' AND '2013-01-03 23:59:59'
GROUP BY uid
HAVING bits_find_N1(BIT_OR(1 << datediff(log_date, '2012-12-30')),
b'11111') IS TRUE;

如果某column 數目要到一定數目

SELECT accountname AS bit, sum(cardamount) FROM tablename
WHERE log_date BETWEEN '2012-12-30 00:00:00' AND '2013-01-03 23:59:59'
GROUP BY uid
HAVING bits_find_N1(BIT_OR(1 &lt;&lt; datediff(log_date, '2012-12-30')),
b'11111') IS TRUE and sum(cardamount)&gt;=1200;

詳細可參考

http://www.mysqlops.com/2012/03/06/an_interesting_query.html

~ 用RootKit Hunter來找linux漏洞 ~

connie 2013.01.05 | ubuntu | | No Comments

先安裝RootKit Hunter

cd /tmp
wget http://ncu.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.0/rkhunter-1.4.0.tar.gz
tar -xvf rkhunter-1.4.0.tar.gz
cd rkhunter-1.4.0
./installer.sh --layout default --install
cd /usr/local/bin
mv rkhunter /usr/bin/

之後update db

rkhunter --update
rkhunter --propupd

之後要修改/etc/rkhunter.conf

nano /etc/rkhunter.conf

加入hidden file whitelist

SCRIPTDIR=/usr/local/lib/rkhunter/scripts

ALLOWHIDDENDIR="/etc/.java"
ALLOWHIDDENDIR="/dev/.udev"

ALLOWHIDDENFILE="/dev/.initramfs"

SCRIPTWHITELIST=/usr/bin/unhide.rb

Scan Machine 方法

rkhunter --checkall

完成

rm -r rkhunter-1.4.0
rm -r rkhunter-1.4.0.tar.gz

 

« Previous Page | HOME |

Smiley face

January 2013
S M T W T F S
« Dec   Feb »
 12345
6789101112
13141516171819
20212223242526
2728293031