顯示具有 電腦、網路 標籤的文章。 顯示所有文章
顯示具有 電腦、網路 標籤的文章。 顯示所有文章

2021年2月3日 星期三

firmware: failed to load iwl-debug-yoyo.bin (-2)

debian_version: bullseye/sid

Error message 

kernel:  iwlwifi 0000:05:00.0: firmware: failed to load iwl-debug-yoyo.bin (-2)

temp solution:

vi /etc/modprobe.d/iwlwifi.conf

add following line:  

options iwlwifi enable_ini=N


disabled this warning after reboot.


Reference link :

https://www.reddit.com/r/debian/comments/i60j1c/firmware_failed_to_load_iwldebugyoyobin_2_debian/

https://patchwork.kernel.org/project/linux-wireless/patch/20200625165210.14904-1-wsa@kernel.org/





2021年1月16日 星期六

Debian 11 bullseye KVM host installation with public bridge network

Debian 11 bullseye KVM host installation with public bridge network


#install packages

#apt install --no-install-recommends qemu-system qemu-utils libvirt-clients libvirt-daemon-system bridge-utils

#adduser <youruser> libvirt

#create bridge interface 
# ip link add br0 type bridge
## brctl addbr br0 (deprecated, use ip link instead!)
# vi /etc/network/interfaces

#add/modify following

......
# The primary network interface
#allow-hotplug eno1 # eno1 is my interface name ,change to yours
#iface eno1 inet dhcp

## kvm bridge
##
iface eno1 inet manual
auto br0
iface br0 inet dhcp
pre-up ip tuntap add dev tap0 mode tap user root
pre-up ip link set tap0 up
bridge_ports eno1 tap0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
post-down ip link set tap0 down
post-down ip tuntap del dev tap0 mode tap



Now you can connect from remote virt-manager something like this: 

qemu+ssh://root@<kvm host br0 IP >/system





2020年12月27日 星期日

Half the money I spend on advertising is wasted



“Half the money I spend on advertising is wasted; the trouble is I don't know which half.” John Wanamaker (1838-1922)

“Half the money you spend on (Facebook) advertising is wasted; the trouble is that even you know which half, nothing you can do still. ” Biologist&Geek (2020)
 
臉書在2016年的內部備忘錄提到,美國用戶的興趣判斷精準度僅達到41%,這表示有超過一半的時間,廣告都打在錯誤的受眾身上,全球用戶的表現甚至更差。一名廣告團隊的成員更直呼臉書的判斷數據「全都是垃圾」,並承認準確性低於預期。
https://newtalk.tw/news/view/2020-12-25/514209


2000年前後我在廣告公司工作,那時就常聽到在將來網路的世界裡,與John Wanamaker的時代不同的是,我們永遠可以知道那一半被浪費掉的廣告費,是哪一半,數位行銷可以克服傳統大眾媒體廣告行銷的先天缺陷,更精確的針對目標消費者傳遞廣告行銷訊息。
 
就跟1970年代開始時,小叮噹設定是21世紀的機器貓一樣,人們對於未來的新科技總是有不切實際的幻想,人類文明與科技的進步實際上並沒有這麼美好。Facebook 的精準廣告投放,效果還是跟百年前廣告行銷大師的名言一樣。
 
1920年代  John Wanamaker:「我知道我的廣告費有一半浪費了,麻煩的是我並不知道是哪一半。」
2020年代  宅男大叔:「你知道你的(臉書)廣告費有一半浪費了,麻煩的是就算你知道是哪一半,你依然無能為力。」

2020年9月5日 星期六

身為一個中年網路工程師會想要換Wifi Router也是正常的

 最近有點手癢,想換掉用了好幾年的TP-Link Archor C7 with Openwrt ,原因是這台的128MB RAM 目前常態使用上都吃掉 70%+ 。但是想想好像也沒啥不穩定或是龜速狀況,所以還是忍住,等到wifi6規格兩年後真的普及了再撿便宜吧。

 

 

2018年8月2日 星期四

Ubuntu 18.04 suspend problem on Zenbook UX410UQK + Nvidia 940M


在 ASUS Zenbook UX410UQK 筆電上 踩到 Nvidia 940MX ,在Ubuntu18.04上 suspend之後系統會掛掉。  目前的18.04.1依然無解。
只好改用最愛的 Debian Sid, kernel 4.17。 OK。

update:
https://wiki.archlinux.org/index.php/bumblebee#Failed_to_initialize_the_NVIDIA_GPU_at_PCI:1:0:0_.28Bumblebee_daemon_reported:_error:_.5BXORG.5D_.28EE.29_NVIDIA.28GPU-0.29.29
I ended up with this service in /etc/systemd/system/gpu-fix.service:

[Unit]
Description=Fix GPU after waking up from suspension
After=suspend.target
[Service]
User=root
Type=oneshot
# Sleep is because we want to ensure fastest wake up
ExecStart=/usr/bin/bash -c "sleep 2 && echo 1 > /sys/bus/pci/rescan"
TimeoutSec=0
[Install]
WantedBy=suspend.target

2018年1月2日 星期二

Synology Router 1900 / 2600 CLI

Synology Router 相關指令

 

How to get a list of connected clients?

wireless.utilities
# Proprietary Broadcom (wl)  ---> Synology RT-1900ac
wl -i wlan0 assoclist
 
# Proprietary Atheros (madwifi)  ---> Synology RT-2600ac
wlanconfig wlan0 list sta
 
# MAC80211
iw dev wlan0 station dump
 
# Universal
iwinfo wlan0/wl0/ath0 assoclist
 
reference : https://wiki.openwrt.org/doc/faq/faq.wireless 

2016年6月27日 星期一

AMD GPGPU 在 HPC 高效能運算還有前途嗎?




目前我用到的人工智慧,機器學習框架套件,都是以 CUDA  GPGPU 為主,沒看過用 AMD GCN 的。(Google tensorflow 有支援 GCN 架構嗎?沒有)


另外,Intel 的 KNL,用一堆 Atom 核心 + HT ,搞出 68 核心 272 Thread ,跑影像辨識好像也沒多大優勢,價格如果不能跟 GPU 競爭( 4876鎂?別鬧了 http://www.hpcwire.com/2016/06/21/intel-launches-knights-landing-phi-family/),那要怎麼打?更何況要發揮 KNL 大量 X86 核心平行運算優勢,程式還得用上 I 家另外一組貴森森的 Mathematical Kenel Libraries ,那是要搞屁?


所以說,N 家還是老神在在,Pascal 的價格你要說是信仰價也好,驅動程式值 5千也好,如果想要接觸深度學習或影像辨識,你就是得要乖乖吞下去。在這些領域,遊戲只是雞肋,CUDA 才是老大。


買一片萬把新台幣的 GPU ,玩遊戲之外還能學新工作技能,跟人家說有接觸過深度學習類神經網路。跟一片七千除了玩遊戲之外, GPGPU 支援程度不佳的遊戲卡,不能對外號稱自己有上進心會學習技術新知。都幾。




2015年7月3日 星期五

Debian 8 Jessie的終端機程式選擇

工作機小黑 X61 前幾天升級到 Jessie,最不習慣的是gnome-terminal 升級後,無法更改 tab 標籤了。工作上我需要用到很多terminal,之前寫了個小script一次開啟多個terminal,自動ssh到需要管理的Linux server,自動更改terminal標籤,方便工作。現在不行了,怎辦?

測試了好幾個終端機模擬: guake / lxterminal / terminator / xfce4-terminal ,最後發現只有 xfce4-terminal 還可以從cli自動修改tab標籤名稱。

修改後的script如下:
#!/bin/bash

xfce4-terminal   --title="server1" -e "ssh server1  --tab  -e "ssh server2" --title="server2"  --tab  -e "ssh server3" --title="server3"  

2014年12月30日 星期二

Trackpoint speed and sensitivity tweek

Addd following line to /etc/rc.local

## Trackpoint speed and sensitivity tweek, echo number 0-255 to sysfs
echo -n 120 > /sys/devices/platform/i8042/serio1/speed
echo -n 220 > /sys/devices/platform/i8042/serio1/sensitivity

一晃神,半年多沒更新這裡了。

2014年6月12日 星期四

How to install star on Debian

Star is a very fast tar(1) like tape archiver with improved functionality. Debian official repo did not include this package, thus need some trick to convert it from Redhat RPM.

Star 號稱是比正常的 Linux tar 還要快、支援格式更多、功能更強的打包軟體。碰到需要在 Debian 環境安裝這個東西,筆記如下:

1. apt-get install alien

2.find and down star RPM from http://www.rpmfind.net/linux/rpm2html/search.php?query=star

3. convert alien RPM package into DEB world
alien star-1.5.2-11.fc21.x86_64.rpm

3. install converted deb
 dpkg -i star_1.5.2-12_amd64.deb

安裝完後指令用法參考mam 或底下網頁

star(1) - Linux man page

2014年5月23日 星期五

程式與數學

所有的程式語言都有某些用來演算數字的特殊符號。別擔心,寫程式的人常常謊稱自己是數學天才,但實際上這些人根本就是數學爛咖。如果寫程式的真是數學天才,他們就應該會成為數學家,而不是坐在位置上寫廣告程式以及社群網路遊戲來騙錢。

Every programming language has some kind of way of doing numbers and math. Do not worry: programmers lie frequently about being math geniuses when they really aren't. If they were math geniuses, they would be doing math, not writing ads and social network games to steal people's money.
-- Learn Python : The Hard Way


2014年4月18日 星期五

NAT環境下從 Linux console取得外部IP位址

一隻小 shell script,一行指令

#! /bin/bash
 echo `curl -s ifconfig.me` | mutt -s ' real IP of my host ' someone@gmail.com


其中curl -s ifconfig.me 是用curl去連結回報真實IP服務的網站,類似的網站還有
curl ident.me
curl tnx.nl/ip
curl icanhazip.com
curl ipecho.net/plain
curl ip.appspot.com



2014年2月21日 星期五

Access MS SQL server from Debian/Linux console - sqlline


1.Install sqlline and jtds (using apt-get )
apt-get install libjtds-java sqlline

2.ms sql jdbc connection string syntax
jdbc:jtds:sqlserver://ip/

3.drive class syntax
net.sourceforge.jtds.jdbc.Driver


4.command line example :
sqlline -u 'jdbc:jtds:sqlserver://ip/' -n user -p pwd -d net.sourceforge.jtds.jdbc.Driver 

5.using pipe redirect
sqlline -u 'jdbc:jtds:sqlserver://ip/' -n user -p pwd -d net.sourceforge.jtds.jdbc.Driver  < script.sql

2014年2月16日 星期日

Linux NIC VLAN config

以Debian為例,

  1. apt-get install vlan
  2. vconfig add eth0 202                   ### 在 eth0上面設定VLAN 202,執行完後系統會多一個 eth0.202 網路卡
  3. ifconfig eth0.1 192.168.202.100  ### 設定 eth0.202 的IP,從這個網路卡出去的 frame都會帶vlan tag 202
vconfig --help
Usage: add             [interface-name] [vlan_id]

       rem             [vlan-name]
       set_flag        [interface-name] [flag-num]       [0 | 1]
       set_egress_map  [vlan-name]      [skb_priority]   [vlan_qos]
       set_ingress_map [vlan-name]      [skb_priority]   [vlan_qos]
       set_name_type   [name-type]

2014年2月9日 星期日

搞笑的QOS

租屋所在的大樓管理委員會,很好心的幫住戶申請了100Mbps網路,還請電腦公司買了價格13600元的VigorSwitch G2260,來做QOS頻寬管理,想要平均分配上網頻寬給大樓住戶,避免有人佔用頻寬造成其他人上網龜速。很好很用心,給好心的管委會鼓鼓掌。

問題出在「電腦公司」。以前看過一篇報導,在台灣工作的日本商社職員,認為台灣人做事馬馬虎虎不講細節,宅男我其實很同意這點,尤其是在跟我的工作相關的電腦、網路方面,常常看到「電腦公司」拿倚天劍當斧頭去森林砍樹,或是拿美工刀當屠龍刀想去挑戰死亡之翼。

VigorSwitch G2260這台設備雖然算不上倚天劍,但是設定對了拿來管理大樓20戶住家的頻寬分配,也算是小菜一碟。但是電腦公司的「工程師」呢,看到機器的設定畫面有個QOS,也許是不懂網路或是英文不懂看,找到個QOS Ingress Port Policers畫面,看到Port / Rate / Unit 這幾個英文字認得,就覺得把所有Port都設定相同速度,頻寬限制的需求就一切OK,Ya~搞定下班又幫公司賺了一筆業績。


--- 線上翻譯分隔線 ---
ingress
*['ingres]
n. 進入, 入口, 準許進入
【法】 進入, 入境, 入口

老實說,宅男我之前也沒用過這台機器,但是設備裝好那天我測試網路就覺得怪,上下載頻寬很明顯都不對。找到機器的管理界面,很好,預設的帳號密碼都沒動,進去參觀看看。看了一下設定後覺得不對,就花了點時間把她改好,測試OK,又度過了一個愉快的夜晚。

隔了幾天之後,下樓倒垃圾的時候遇到大樓管委會大伯,跟他提到這件事。大伯半信半疑的回答我,電腦公司說已經安裝好,100Mbps下載頻寬分配給20戶,每戶分配4Mb下載,10Mbps上傳則分配每用戶50Kbps(中華電信光世代雖然號稱100M,但是因為距離關係我們大樓大約只能跑80-90Mbps),不會有問題才對。我告訴他,沒有問題是因為我改好設定了。管委會大伯眼光中滿是懷疑,我請大伯下次如果電腦公司的人要來安裝設定第二路光世代線路,可以找我一起討論,我可以跟他們說設定原理和設定方法。

過了兩天我又覺得網路速度龜,想試著連上VigorSwitch G2260看看,發現密碼已經被改了,當下心裡明白,終究這些人聽不進去真話,也不願面對自己的無知。後來又遇到電腦公司的人在樓下設定第二路光世代,白目的宅男還是忍不住跟那位先生提了一下,說他們的設定有錯,並大略解釋Port base QOS的基本運作。沒用,感覺上就一副「您哪位啊?」的表情,只回應:「我回去再請工程師看看」。

現在呢,設定錯的G2260依然運作著,也沒其他人發現狀況不大對。錯誤的設定造成上載頻寬沒被限制好,我可以用10Mb的速度爽爽上傳好看的來分享;而晚上塞車時間則是大家擠著用10Mb的下載,頻寬管制名存實亡。我沒差,反正是租屋於此,也不用付管理費,就當是撿到的上傳頻寬爽爽用吧。

2013年10月4日 星期五

Fortigate reset trusthost setting 重設信任主機欄位設定


如果不小心把Fortigate的Admin 管理者信任主機欄位設定錯誤,導致無法從網頁管理界面或 ssh / telnet 登入管理,可以透過Fortigate的console埠重設信任主機欄位。以下是從Linux / Debian 電腦上面,透過USB轉序列埠連接上Fortigate。


Fortigate serial port configuration : 9600 8N1 / none HW flow control / none SW flow control

Under Linux terminal :

Option 1 : cu command

:~$ cu -l /dev/ttyUSB0 -s 9600 --parity=none --nostop
Connected.
FGT60C login:
FGT60C login: admin
Password: ******
Welcome !
FGT60C #


FGT60C # config system admin
FGT60C (admin) # edit admin
FGT60C (admin) # unset trusthost1
FGT60C (admin) # unset trusthost2
FGT60C (admin) # unset trusthost3
FGT60C (admin) # unset trusthost4
FGT60C (admin) # end
FGT60C # exit
FGT60C login: ~.

( here the last input "~." is the disconnect string of cu )


Option 2 : minicom command
:~$ minicom -D /dev/ttyUSB0 -b 9600 -8

others the same as above, use ctrl-a then press x to confirm leave minicom.

2013年7月23日 星期二

Procedure to install Bugzilla on Debian Wheezy without using install-module.pl


Procedure to install Bugzilla on Debian Wheezy without using install-module.pl

No build-essential / make  or other development  package needed, no CPAN / perl module manually compile needed.

Pre-request:

  1. system already installed apache2 and mysql and perl.
  2. already configured mysql user/password for bugzilla, using root or other account



##get bugzilla tarball
wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.tar.gz
tar xzvf bugzilla-4.4.tar.gz
mv bugzilla-4.4 /var/www/bugzilla

##install necessary perl modules
apt-get install libapache2-mod-perl2 libdatetime-perl libemail-send-perl libtemplate-perl libemail-mime-perl liburi-perl liblist-moreutils-perl  libmath-random-isaac-perl libgd-graph-perl libchart-perl libtemplate-plugin-gd-perl

##generate localonfig file by ./checksetup.pl
cd /var/www/bugzilla
./checksetup.pl

##modify localconfig
## Debian use www-data:www-data as apache2 daemon user:group
vi localconfig
change --> $webservergroup = 'www-data';
change --> $db_user = 'user For Bugzilla';
change --> $db_pass = 'password For Bugzilla';

##run checksetup.pl again , auto setup db and administrator users
## checksetup.pl will ask for administrator email as admin account
Enter the e-mail address of the administrator: bug@m$
Enter the real name of the administrator: M$ Bug
Enter a password for the administrator account:
Please retype the password to verify:
dodgelin@gmail.com is now set up as an administrator.


## modify /etc/apache2/apache2.conf , append floolwing two line, like below
tail -2 /etc/httpd/conf/httpd.conf
PerlSwitches -I/var/www/bugzilla -I /var/www/bugzilla/lib -w -T
PerlConfigRequire /var/www/bugzilla/mod_perl.pl

## add apache2 alias config
vi /etc/apache2/conf.d/bugzilla

## add bugzilla alias as following
Alias /bugzilla/ "/var/www/bugzilla/"

  AddHandler cgi-script .cgi .pl
  Options +Indexes +ExecCGI +FollowSymLinks
  DirectoryIndex index.cgi
  AllowOverride Limit



##modify /var/www/bugzilla/mod.pl
##remark following lines due to lack of Apache::SizeLimit
##otherwise you will see a error message when starting APACHE2 
## "You must install Linux::Pid for Apache::SizeLimit to work on your platform."
vi /var/www/bugzilla/mod.pl

##find following section and remark it.
#use Apache2::SizeLimit;
# This means that every httpd child will die after processing
# a CGI if it is taking up more than 45MB of RAM all by itself,
# not counting RAM it is sharing with the other httpd processes.
#Apache2::SizeLimit->set_max_unshared_size(45_000);

## restart apache2
/etc/init.d/apache2 restart

##Done.







2013年7月22日 星期一

Android TV盒? Android mini PC ?

一個比信用卡還小一點的隨身Android裝置,加上無線鍵盤滑鼠,接上客廳的電視作為螢幕,這樣的電腦設備會是PC的替代方案嗎?

有個朋友在網路上開山立寨,代理這個Android 4.2 版+四核心CPU+2GB RAM的小玩具在台灣販賣,宅男大叔對這類設備一直很有興趣,也買了一個來玩玩看。

在MK908小小的體積裡面,CPU硬體與GPU提供的運算能力可能比得上五年前工作用的筆記電腦,記憶體也是高規格的2GB,加上Google play上面有數不清的應用程式,免費的付費的各式各樣的,以及以Chrome browser為平台的HTML5應用,應付簡單的上網、文書應用照理講應該沒問題,這樣一來,不是就可以取代掉所謂的入門文書機PC了?在動手玩之前,我抱著這樣的期待。

實際使用之後的感想:當作智慧型電視機上盒,這隻MK908算是及格,但作為 mini PC,穩定性還有進步空間。

我測試的環境主要有二,一個是接22吋Full HD的電腦螢幕,一個是接32吋的Sharp 720P電視。MK908有內建Wifi和藍牙,但是wifi部份比較不穩定,朋友另外給了一個USB Ethernet網卡,接上網路線之後,網路傳輸狀況會穩定許多。另外我使用2.4G的無線滑鼠在電視和螢幕上操作Android。藍牙鍵盤( Sony PS3 藍牙鍵盤 ) 和 ASUS 藍牙滑鼠無法成功和這台配對

就看電視的部份來說,這隻玩具看youtube,看 rmvb / mp4 / mkv 等等視訊格式都勝任愉快,比起家中另外一台用來播放DVD的 xbox 360 有彈性,Android上面有各式各樣的播放軟體,可支援的影片格式比起xbox360好多了。但是這隻玩具的硬體穩定性還不完美,只能說堪用。我用MK908看了大約3個小時的 720P MP4 / RMVB / MKV動畫,過程中遇到兩次當機,兩次聲音消失。就看影片的需求來說,我還可以接受。使用的軟體是 mxplayer,影片放在外接的32GB SD卡中。

透過MK908在電視上看youtube或影片檔,我給稍稍及格一點的分數,65分。但是用來在電視上瀏覽網站、玩遊戲,MK908就有嚴重的缺陷,對我來說是不及格的。

照理說,影片播放順利的話,看網頁或是玩小遊戲應該不會造成系統更大負擔才對?但是很奇怪地,這隻玩具在使用Chrome瀏覽網站的時候,穩定性比看影片差很多,機體溫度也比較高,很像散熱不良熱當,很容易當機。感覺上只是瀏覽網站,玩玩Candy Crush,大約一個小時就會當機。放台電風扇吹這玩意,狀況會有改善,為了測試是否真的是散熱問題導致不穩定,以安兔兔的穩定性測試功能為標準,不吹電風扇狀況,穩定性測試執行到一半就會當機,用風扇協助散熱就可以正常跑完測試。所以基本上MK908是「冬期限定」吧,在炎炎夏日裡,不開空調的環境還要一台電風扇專門伺候它,以3C產品來說很不應該。

最後,在大電視螢幕上玩Candy Crush Saga滿爽的,糖果都好大一顆。












2013年7月14日 星期日

bash下批次縮小gif動畫指令 -- 使用 gifsicle


gifsicle --scale 0.5 --batch -i *.gif

需要安裝gifsicle套件,且上面這作法會直接複寫原本目錄中的檔案(scale in place )

bash下批次縮小目前目錄中所有圖片

指令:

for file in *; do convert $file -scale 50% ../small_0.5/`basename $file`; done

上述指令可以將目錄內所有檔案縮小50%,存放到上層的small_0.5目錄中


上面這個作法遇到gif動畫會破功,無法產生縮放過後的gif動畫,只剩下第一個frame。要能正確縮放gif動畫,需用到底下

for file in *; do convert  $file -coalesce -scale 50%  ../small_0.5/`basename $file`; done

for file in *; do convert  $file -coalesce -sample 50%  ../small_0.5/`basename $file`; done

兩種作法都可以,但是根據文件,產生的結果可能畫質上會有所差異,哪個方法比較好可能要看實際狀況才能判斷。

ImageMagick參考資料:
http://www.imagemagick.org/Usage/anim_mods/#crop

以上需要有ImageMagick套件(convert 這隻程式屬於ImageMagick套件成員之一)