個人心情和 Linux / FreeBSD 等技術

2020/09/15

CVE-2020-14386 kernel 漏洞

 Ref:  https://www.openwall.com/lists/oss-security/2020/09/03/3

影響範圍:

這個漏洞會允許 docker 環境直接拿到 host node 環境的 root 權限GKE 環境直接被影響了。

看 Google 官方建議修復:

To fix this vulnerability, upgrade your control plane, and then your nodes to one of the patched versions listed below:

  • 1.14.10-gke.50
  • 1.15.12-gke.20
  • 1.16.13-gke.401
  • 1.17.9-gke.1504
  • 1.18.6-gke.3504

2020/05/19

MacOS 中點擊視窗標題列會縮放的效果

如題,今天重安網路安裝 MacOS 到 Catalina 10.15.4 版本後發現這個預設行為改變了,變成了不會縮放,找了半天才找到。

筆記一下是在
系統偏好設定->Dock->按兩下視窗的標題列來縮放


2016/10/15

debian 8 多音效卡

簡單的方式
安裝  pavucontrol 即可解決


2011/06/08

cisco 推出了新型 router ASR9000

http://newsroom.cisco.com/dlls/2011/prod_060711b.html

看了一下是針對影像推出的產品, 不過那個接近真人高的高度是發生啥事..

更新一下..算是舊產品但內容升級了

2011/03/09

Daughtry - Poker Face

原來當然是 lady gaga 唱的

Daughtry 吉他版本我覺得翻唱的不錯的

2011/03/04

升級到 freebsd 8.2 備忘

The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 7.[01234]-RELEASE, 8.[01]-RELEASE, 8.2-BETA1, or 8.2-RC[123] can upgrade as follows:
# freebsd-update upgrade -r 8.2-RELEASE


During this process, FreeBSD Update may ask the user to help by merging some configuration files or by confirming that the automatically performed merging was done correctly.
# freebsd-update install


The system must be rebooted with the newly installed kernel before continuing.
# shutdown -r now


After rebooting, freebsd-update needs to be run again to install the new userland components:
# freebsd-update install


At this point, users of systems being upgraded from FreeBSD 7.4-RELEASE or earlier will be prompted by freebsd-update to rebuild all third-party applications (e.g., ports installed from the ports tree) due to updates in system libraries.


為了 rebuild  third-party application , 最快的方式就是全部移除掉重來..


免的解一些奇怪的 ports bug , 這邊參考  portmaster


Using portmaster to do a complete reinstallation of all your ports:
1. portmaster --list-origins > ~/installed-port-list
2. Update your ports tree
3. portmaster -ty --clean-distfiles
4. portmaster --check-port-dbdir
5. portmaster -Faf
6. pkg_delete '*'
7. rm -rf /usr/local/lib/compat/pkg
8. Back up any files in /usr/local you wish to save,
such as configuration files in /usr/local/etc
9. Manually check /usr/local and /var/db/pkg
to make sure that they are really empty
10. Re-install portmaster
11. portmaster `cat ~/installed-port-list`




After updating installed third-party applications (and again, only if freebsd-update printed a message indicating that this was necessary), run freebsd-update again so that it can delete the old (no longer used) system libraries:
# freebsd-update install


Finally, reboot into 8.2-RELEASE:
# shutdown -r now


參考: http://www.freebsd.org/releases/8.2R/announce.html 

2011/02/25

trafficserver 2.1.5 在 Debian Squeeze 上的安裝

拿 trafficserver 2.1.5 版..

做個紀錄

$ sudo groupadd -g 3128 trafficserver
$ sudo useradd -g 3128 -u 3128 -r trafficserver
$ sudo aptitude install autoconf automake libtool g++ libssl-dev tcl-dev expat libexpat1-dev libpcre3-dev libsqlite3-dev



編譯選項
sudo ./configure --with-user=trafficserver --with-group=trafficserver  --with-gnu-ld

註記

*2.1.5 版開啟 --enable-webui  會踩到 bug 編譯失敗 , 2.1.4 版則是可以編譯成功, 但老實說畫面實在是太陽春...無用 = =

*另外 build instruction 上寫到需要 libexpat-dev , squeeze 上已經不叫這名稱..

參考 : http://svn.apache.org/repos/asf/trafficserver/traffic/trunk/README

2010/09/07

Debian Backports 變成官方 site 了



這兩天看到的新聞

backports 這個設計是可以從裡面拉一些比較新又不會更新 library 的套件 ex: iceweasel..

我個人的桌機可以從 backports 裡拉到 3.5.11 的版本

使用一樣的簡單

先將
deb http://backports.debian.org/debian-backports lenny-backports main contrib non-free
這行加入 /etc/apt/sources.list 之後

記得安裝 debian-backports-keyring 就能夠用 aptitude 來安裝拉

其他部份 backports 上寫的很清楚

2010/08/14

firefox 啟用 java plugin

最近重裝系統後有些小問題 (汗)



由於連回公司的 vpn 需要啟用 java ,



我的系統 lenny 雖然裝了 sun-java6-jre 但是在 iceweasel 上會遇到他說尚未安裝的情況,



解決方式..



$ sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.20/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/



soft link 以後再把 iceweasel 重跑就解決了

2010/07/06

生命之歌 - 盧皆興

我對原住民有著特別的感情,實在三言兩語說不完





2010/06/16

在 Debian 上跑 lusca reverse proxy

紀錄一下算是備忘, lusca 是修改自著名 proxy 軟體 squid

由於最近自己在 Debian 上自行編譯惡搞....完全是 bsd style

預設直接跑 configure 的話給的 cflag 很少..所以得自己 hack

sudo 環境底下的話會變成像這樣

sudo "CFLAGS=-m64 -Wall -g -O2 -pipe -march=native -fno-strict-aliasing -D_REENTRANT" ./configure blablabla
有興趣的話請自行翻閱 gcc 的 CFLAGS 是代表啥意思

--enable-epoll --with-pthreads 算是重要的編譯選項,最好加個

--disable-select --disable-poll 確保 squid 不會用 select 或是 poll 來跑

檔案系統是 reiserfs ( best for random access ), squid storeio 則選擇 aufs,

雖然我聽到很多說法是 diskd 比 aufs 效能好,(當然也有建議跑 aufs 的拉)

...但就以前在縣網裡跑在 FreeBSD 4 、5 版上面的經驗是效能不怎麼樣 . . .

而且當時跑 diskd 還要額外重編譯核心

比較特別的是 lusca 如果是藏在 load balancer 底下的話編譯時可加個

--enable-follow-x-forwarded-for
然後在 squid.conf 中 加上
follow_x_forwarded_for allow (NAME)
forwarded_for on

才能讓 squid 紀錄到外部真實的 IP

另外這次沒有編譯到 --enable-async-io ,但由於是使用萬轉的硬碟

目前 bottleneck 不在硬碟上,所以也就還好。

其他關於 squid 最佳化的說明可參考之前文章
squid 效能等注意事項!

2010/02/14

Secret Garden - Always there

很喜歡這首歌
沒記錯的話應該是 RUSSELL WATSON 唱的

2009/10/25

ADELE - Make You Feel My Love





When the rain is blowing in your face

And the whole world is on your case

I could offer you a warm embrace

To make you feel my love



When the evening shadows and the stars appear

And there is no one there to dry your tears

I could hold you for a million years

To make you feel my love



I know you haven't made your mind up yet

But I would never do you wrong

I've known it from the moment that we met

No doubt in my mind where you belong



I'd go hungry, I'd go black and blue

I'd go crawling down the avenue

There's nothing that I wouldn't do

To make you feel my love



The storms are raging on the rollin' sea

And on the highway of regret

The winds of change are blowing wild and free

You ain't seen nothing like me yet



I could make you happy, make your dreams come true

Nothing that I wouldn't do

Go to the ends of the earth for you

To make you feel my love

2009/10/19

Argument list too long

錯誤訊息是


bash: /bin/rm: Argument list too long


今天用 rm -f db-* 遇到這個問題 ...


有點鳥呀


改用 find . -name "db-*" | xargs rm -f 就跑的蠻正常的

2009/10/09

Plugin 'InnoDB' init function returned error

我被這問題困擾了好久...


以下是完整的錯誤訊息


InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes
InnoDB: than specified in the .cnf file 0 268435456 bytes!
091009 1:52:14 [ERROR] Plugin 'InnoDB' init function returned error.
091009 1:52:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
091009 1:52:14 [ERROR] Unknown/unsupported table type: InnoDB
091009 1:52:14 [ERROR] Aborting




work around 的方式

1. 先把 mysql 停下來
2. 我把 ib_logfile0 和 ib_logfile0 直接移除了
3. 重跑 mysql 就好了 0rz


好了之後再來用 maatkit 修復 replication

2009/09/21

重新開始

無須多說什麼,就聽吧

mysql slave replication error

error log 裡面出現了這行...


Error: log file ./ib_logfile0 is of different size 0 67108864 bytes


仔細查才發現 master 的 my.cnf 裡面
innodb_log_file_size = 64M


而 replication slave 的 my.cnf
innodb_log_file_size = 8M


這樣跑就會出錯了,把 slave 的 my.cnf 改成和 master 一樣的大小就行了

2009/08/27

ssh-keygen

這已經在公司用了好久了,不是什麼了不起的應用

來這裡筆記一下吧

詳細的使用看 manpage 第一段就明確的告訴你

ssh-keygen generates, manages and converts authentication keys
for ssh(1). ssh-keygen can create
RSA keys for use by
SSH protocol version 1 and RSA or DSA keys for use by SSH
protocol version 2. The type of key to be generated is specified
with the -t option. If invoked without any arguments, ssh-keygen
will generate an RSA key for use in SSH protocol 2 connections.

預設不自作聰明的帶參數的話會是 SSH protocol 2 可使用的 RSA key。

但是 RSA非對稱式加密 有些歷史因素,個人認為在 1024 bits 以下都很危險..


所以個人還是偏好使用 DSA演算法

廢話不多說來產生 key

rellik@desktop(01:05:08)[~]$
ssh-keygen -t dsa

Generating public/private dsa key pair.
Enter file in which to save the key (/home/rellik/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/rellik/.ssh/id_dsa.
Your public key has been saved in /home/rellik/.ssh/id_dsa.pub.

大概按兩三次 Enter 鍵就結束了

而在工作環境下我的 HOME 目錄又是使用 NFS 掛載到每一台機器上的

這有個好處可以讓我快速的游移在多台機器中不需要打帳號密碼節省了

很多敲鍵盤的時間。

作法是在 $HOME/.ssh 目錄底下建立一個 authorized_keys

然後把 $HOME/.ssh/id_dsa.pub (記得是 public key 呀)貼到

authorized_keys 裡,權限 600 ,這樣就可以利用 nfs 快速的在

機器間遊走了 。

最後忘了說,Debian liked 的系統強烈建議安裝 openssh-blacklist

這個套件 ......, 不清楚的人可參考之前的文章 Debian的openssl漏洞

2009/07/13

難得一見的畫面

先說說我幹了啥事,我只是在灌我們家的機器時測試


了最新一周的Debian testing weekly build,然後在


root partition 跑ext4+raid1 , 才剛裝完重開後就看到


以下的畫面