工作笔记 — Reset MySQL Root 密码

有时候一次过手上可能会做好几个Project。一时没注意很可能就会把某个Project的密码忘掉,而需要费事费力把它找回。

今天就遇到这问题了。。。我忘了MySQL的Root密码。。。
<img src="/plugins/HC_Emoticons/emoticons/red/red%2852%29.png" alt="狂汗" longdesc="” border=”0″>

还好谷歌大神中真的是什么都有,但为了以防万一,我还是自己做一份记录好了。现在的MySQL用户目录如果真的要找某些东西,很可能需要花费上一整天都未必能找到要的。。。

Step1:关闭MySQL服务
# /etc/init.d/mysql stop

Step2 : 利用 –skip-grant-tables指令,跳过密码验证。
# /usr/bin/mysqld-safe –skip-grant-tables

(注:mysqld-safe为启动MySQL服务器于独立运作模式。除了localhost,不接受外界登陆)

成功启动时会看到以下字眼:

Starting mysqld daemon with databases from /var/lib/mysql

Step3 : 通过指令符,用root进入MySQL。这次可以省略密码。
# mysql -u root

Step4 : 为root用户设定新密码
mysql> use mysql;
mysql> update user set password=PASSWORD(“新密码”) where User=”root”;
mysql> flush privileges;
mysql> quit

Step5 : 关闭MySQL-Safe服务
# /etc/init.d/mysql stop

Step6 : 重启MySQL服务
# /etc/init.d/mysql start

完成。

工作笔记 — NTP (Linux上的时间同步服务。

NTP是一个同步世界时间的标准。

电脑由于某些设计上的天生缺陷,在长时间运作后,它的时间都会慢慢的不准。而通过NTP就可以让它自动调整。这个功能在服务器上尤其重要。

在Linux系统上,NTP自动调整可以通过ntpd这个小程序达成。

指令:service ntpd status
用于检查ntpd是否有在运作。

指令:ntpdate my.ntp.server.url1 my.ntp.server.url2 …
用于手动同步时间。如果ntpd正在运作,这个指令将返回『the NTP socket is in use, exiting』错误讯息。
ntp server可以用time.windows.com或time.apple.com。或者一些公开的NTP Free Server都可以。

指令:date
检查目前系统的日期和时间。

——————-

问题解决:
如果面对在手动更新时发现以下问题时。。。

[root@web54 root]# ntpdate ca.pool.ntp.org
7 Jan 00:44:33 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:34 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:35 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:36 ntpdate[28185]: sendto(216.234.161.11): Operation not permitted
7 Jan 00:44:37 ntpdate[28185]: no server suitable for synchronization found

请检查你的防火墙是否已经打开了Port 123。

Windows笔记 – 用Notepad截下开机启动程序(补充)

有时候电脑被病毒侵蚀太过严重了,就算是要在电脑上进行去毒工作也非常困难,电脑变得太慢。

可以使用Notepad截下电脑开机时,所自动启动的程序,而不让它进入到记忆体内,进而可以允许技术员有充足时间,可以更加快速的处理完毕中毒的电脑。下面的指令必须要在指令符(Command Prompt)中输入,重启电脑后才见到效果。

截下程序的指令:(把自动启动程式转到notepad启动)
ftype exefile=notepad.exe %1

还原截取指令:(把自动启动程式还原)
ftype exefile=%1 %*

原理是Windows电脑在启动时必须先经历CMOS -> MBR -> Shell -> Explorer -> Run Programs的必定流程。上述指令会让Explorer在Run Program时把notepad当成是预设的启动程式,而把Run Program交由notepad来启动。由于Notepad只处理纯文字,所以这时候会变成有很多个Notepad窗口弹出,每个窗口就代表一个Run Program的程式,内容大部分会是乱码,不必理会。

2009年最佳Porn Search Engine?

20090611 – Update:
Bing暂时做了些修改,把Video搜寻的链接拿掉了。但如果要进去,还可以通过http://bing.com/video来进入。。。

说真的不晓得是要夸奖,还是要狂贬它。。。

MSN最新推出一个名为Bing的搜索引擎。宣传上号称目前最强(比MSN Live),而原来的live.com也已经被转向到这个新的服务上了。其中一个最新的功能竟然被网民们给了个称号:

2009年度最佳Porn Search Engine。。。
<img src="/plugins/HC_Emoticons/emoticons/onm/on07.gif" alt="汗" longdesc="” border=”0″>

原因是这个新功能可以让网民在不必打开搜寻得到的网址之下,直接预览搜寻得到的结果。只需把鼠标移到这些预览图片上,它就会自动播放预览内容。

其中最搞笑的是,如果你只能在使用FF的情况下,才能够看到搜寻影片的选项,而使用IE的则没有。

用户插入图片
FF抓下来的画面

是不是说微软为了要抓取FF用户的心,而专门让FF用户有这种特别服务呢?
<img src="/plugins/HC_Emoticons/emoticons/onm/on09.gif" alt="快樂" longdesc="” border=”0″>

有兴趣要尝鲜的朋友们可以随着一下步骤来做:

(事先说明:这是18sx+++的哦!被抓别赖我!)

  1. 进入bing.com这个页面。
  2. 按下左手边的video。
  3. 在搜寻栏上输入Porn之类的搜寻字眼。
  4. 按下放大镜后,找出Safe Search Method(Change)
  5. 按下Change,然后选择Off
  6. 把鼠标移到预览画面上看看。。。(记得先把声量调小或用耳机!!!)

<img src="/plugins/HC_Emoticons/emoticons/onm/on21.gif" alt="噴鼻血" longdesc="” border=”0″>
如果你只有IE,可以用这个短链接:http://riku.me/vl9直接跳进去观看结果。

看来网管们又有得忙。
是时候要考虑一下是否要完全封杀这个网址了。。。

说真的,如果这个新网址由于这个功能就被网管们设成是『限制级别』那么真的是一微软的另一大创举了。。。
<img src="/plugins/HC_Emoticons/emoticons/tuski/18.gif" alt="竊笑" longdesc="” border=”0″>

TiltShift?我也行!!!

来来来~看看我的作品。<img src="/plugins/HC_Emoticons/emoticons/red/red%288%29.png" alt="傻笑" longdesc="” border=”0″>

用户插入图片
tiltshift!

这真的不是用Picasa做的哦!!!
<img src="/plugins/HC_Emoticons/emoticons/red/red%2852%29.png" alt="狂汗" longdesc="” border=”0″>

[#M_《这还有!》|》嘻嘻~《|是的,TiltShift镜头真的太昂贵了说~

还好现在的电脑技术和计算能力一日千里的情况下,我们这些老百姓也有机会拥有TiltShift的镜头 — 『相似的效果』。

用户插入图片
是啦~
就算是用不同的镜头也没法子拍到同一个场景。这两张图片是用软件做出来的。

PS?太慢了吧?
新时代的人嘛~肯定要用最新的科技,在最短的时间内可以达成目标的才是正道!<img src="../../../../plugins/HC_Emoticons/emoticons/red/red%2851%29.png" alt="我啥" longdesc="” border=”0″>

有兴趣要看看是什么?
我会在下面告诉你~

[#M_ 《按这。。。》|乖~|

为了测试一下你的耐性,我暂时不告诉你。
<img src="/plugins/HC_Emoticons/emoticons/red/red%2832%29.png" alt="插花" longdesc="” border=”0″>

[#M_ 《再按一次。。。》| 嘿~ |

哦~你的耐心真的让我感动到~~~
<img src="/plugins/HC_Emoticons/emoticons/red/red%2836%29.png" alt="大笑" longdesc="” border=”0″>

[#M_ 《不过哦~还是不太够。。。》 | 。。。 |

其实哦~要找一个软件真的非常困难的,尤其是这样好的软件更加是难上加难!
用户插入图片

所以哦~
既然我已经拥有这个软件的链接,那么你就可以轻松的拥有咯~

可是。。。
随便下载一个软件并不是一个很好的习惯。

这。。。需要很大的勇气才行!
所以。。。

我还是想测试一下到底你的勇气有多大。。。
<img src="/plugins/HC_Emoticons/emoticons/red/red%286%29.png" alt="怒视" longdesc="” border=”0″>

[#M_ 《既然到了这里,再按多一次应该也无所谓吧?》 | 。。。 |

嘿~你的勇气真的不错。。。
<img src="/plugins/HC_Emoticons/emoticons/red/red%2838%29.png" alt="hoho" longdesc="” border=”0″>

但接下来。。。
我要事先说明:

任何损失,与小弟无关!

[#M_ 《来吧!让我看看你的热情!!!》 | 。。。 |

哇~你还真的按了进来。。。
<img src="/plugins/HC_Emoticons/emoticons/red/red%2852%29.png" alt="狂汗" longdesc="” border=”0″>

如果我说 —- 我忘了抄下这个软件的链接呢?
我会不会被打?
<img src="/plugins/HC_Emoticons/emoticons/red/red%283%29.png" alt="惊讶" longdesc="” border=”0″>

你应该没有这么暴力吧?
<img src="/plugins/HC_Emoticons/emoticons/red/red%2868%29.png" alt="啥?" longdesc="” border=”0″>

其实答案早就写了在下面。。。
试试按下『Ctr』+『A』。。。

<img src="/plugins/HC_Emoticons/emoticons/red/red%288%29.png" alt="傻笑" longdesc="” border=”0″>

<img src="/plugins/HC_Emoticons/emoticons/S4/s4_25.gif" alt="批特藍藍路" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_24.gif" alt="玟玟藍藍路" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_23.gif" alt="呵呵藍藍路" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_22.gif" alt="可樂藍藍路" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_21.gif" alt="哈妮藍藍路" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_20.gif" alt="藍藍路" longdesc="” border=”0″>

<img src="/plugins/HC_Emoticons/emoticons/S4/s4_19.gif" alt="哈妮台客舞" longdesc="” border=”0″><img src="/plugins/HC_Emoticons/emoticons/S4/s4_18.gif" alt="台客舞" longdesc="” border=”0″>

<img src="/plugins/HC_Emoticons/emoticons/tuski/09.gif" alt="再見" longdesc="” border=”0″>

_M#]

_M#]

_M#]

_M#]

_M#]_M#]

链接在这啦~
http://labs.artandmobile.com/tiltshift/