租屋注意事項筆記

差不多又到了學生在外找租屋的季節(?)了,為了避免自己忘東忘西,所以就做了一些筆記,不用每次找房都要想半天,除了租金以外,有哪些東西是應該列入考量或是可以列入考量的,既然有整理出一些東西,也就順便分享給大家參考。

住處週邊考量:

  • 噪音
    • 跟大馬路或商圈的距離等
  • 整潔
  • 週邊生活機能
  • 交通便利性
    • 公車、客運、火車、捷運、高鐵、社區巴士等
    • 缺乏公共交通工具、但離學校或公司距離近也是很好

公共設施、住戶服務:

  • 有無管理員常駐?可否代收信件、包裹?
  • 有無提供飲水機?
    • 只有熱水? 還是冷/溫水+熱水?  冰+溫+熱水?
    • 有無定期更換濾心?
  • 有無提供冰箱?
    • 有無定期清理?
  • 有無提供洗衣機、烘衣機、脫水機?
    • 有無定期清洗?
  • 有無公共空間、電梯、出入口等地點有無監視器?
  • 是否有停放汽、機車位?
    • 室內?室外?
  • 有無晾衣間、曬衣場?
    •  室內?室外?
  • 有無陽台?
  • 有無門禁管理?
  • 有無微波爐?
  • 公共空間是否定期打掃?
  • 有無滅火器?
  • 有無緊急照明燈?

閱讀全文

Remove Exif info in jpg image under command line

Exif, stands for Exchangeable image file format, which we usually use to recognize the camera manufacturer, model, exposure time in a digital photo, it is a standard that specifies the formats for images, sound, and ancillary tags used by digital cameras (or digital devices in nowadays, like smart phones and tablets), scanners and other systems handling image and sound files recorded by digital cameras.

406px-Konqueror_Exif_data.jpg
Exif in JPEG image example from Wikipedia: https://en.wikipedia.org/wiki/File:Konqueror_Exif_data.jpg

Exif can help us know more about the photos and audios, but may also leaks the valuable and privacy info if you don’t want to let others know that you just want to share pictures with others, it will also cost a small disk space, but if you don’t need it or you don’t want it, it’s also a waste of disk space, so you may want to remove that info like me in some situation. Here is the steps to remove Exif under command line.

Install exiftool:

$ sudo pkg install p5-Image-ExifTool # FreeBSD
$ sudo apt-get install libimage-exiftool-perl # Debian / Ubuntu based GNU/Linux
$ sudo yum install perl-Image-ExifTool # RedHat / Fedora based GNU/Linux

Make sure you can now use exiftool:

$ exiftool -ver # show the installed version of exiftool
9.46

If you would like to see the current exist info, use this command, filename.jpg is the picture you want to manipulate:

$ exiftool -all filename.jpg

Now you can remove Exif info:

$ exiftool -all= filename.jpg

By default, it will backup your file to filename_oringinal, like filename.jpg -> filename.jpg_original, so you don’t need to worry about the backup, if you don’t want it, you can also add parameter -overwrite_original to prevent to backup file been generated.

After you remove the Exif info, you will find the modified file be a little bit smaller now.

$ exiftool -all= filename.JPG
1 image files updated

$ ls -l
-rw-r--r-- 1 peter peter 1609796 Apr 24 16:09 filename.jpg
-rw-r--r-- 1 peter peter 1614079 Apr 24 16:08 filename.jpg_original

If you take a look at its info, you will find that there are only some basic info remaining:

$ exiftool -all filename.jpg
ExifTool Version Number : 10.10
File Name : DSC_0470.JPG
Directory : .
File Size : 1572 kB
File Modification Date/Time : 2016:04:24 16:09:43+08:00
File Access Date/Time : 2016:04:24 16:09:43+08:00
File Inode Change Date/Time : 2016:04:24 16:09:43+08:00
File Permissions : rw-r--r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Image Width : 3920
Image Height : 2204
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 3920x2204
Megapixels : 8.6

That’s all.

rsync 只同步特定格式/副檔名檔案的方法

想要用 rsync 同步特定格式的檔案,最近比較沒空動腦認真想,只好 Google 找現成的答案,在 stackoverflow 和 Ubuntu forums 看到的方法,很實用:

http://ubuntuforums.org/showthread.php?t=763833&p=8546521#post8546521

https://stackoverflow.com/a/11111793

[bash]
rsync -a –include ‘*/’ –include ‘*.mp3’ –exclude ‘*’ source/ target/
[/bash]

看 stackoverflow 那邊討論是寫 rsync 3.0.7 以前的版本的用法要這樣寫,那個 exclude 和 include 的順序有影響 :

[bash]
rsync -a –include ‘*/’ –exclude ‘*’ –include ‘*.mp3’ source/ target/
[/bash]

不過我自己是沒特別測試過就是了,隨手翻了一下 change log 好像沒看到相關的說明:

所以不確定是不是真的從 rsync v3.0.7 改了用法還是怎麼樣,等哪天有空再來翻翻看 …

Copy / pipe text from command line to clipboard and vise versa

xclip is command line interface to X selections/clipboard that is designed to run on any system with any X11 implementation, with xclip, we can not easily manipulate the data on the clipboard under a terminal in X11, no need to open a file for just copy its content anymore, and no need to move the mouse to select the output and copy it anymore. Except xclip, there is also a similar program called xsel, google it if you are interested in.

The homepage of xclip:

It’s very to install xclip via apt-get under Debian / Ubuntu based GNU/Linux distros or via pkgng under FreeBSD:
[bash]
$ sudo apt-get install xclip   # on Debian / Ubuntu based GNU/Linux distros
$ sudo pkg install xclip        # on FreeBSD
[/bash]

So how to use it?

If you want to copy something to clipboard, just pipe to xclip like this:
[bash]
$ echo “Hello xclip” | xclip -selection clipboard
[/bash]

Now you can paste it as usual.

If you want to show something from clipboard, just call xclip to output:

[bash]
$ xclip -selection clipboard -o
[/bash]

xclip will output to standard output (stdout), so you can pipe or redirect the result to other utility and do some works you want.