2016年3月8日 星期二

ubuntu 14.04 装 tftp server

1.安裝套件

sudo apt-get install xinetd tftpd tftp


2.sudo vi /etc/xinetd.d/tftp 

service tftp
{
    protocol        = udp
    port            = 69
    socket_type     = dgram
    wait            = yes
    user            = nobody
    server          = /usr/sbin/in.tftpd
    server_args     = ~/tftp
    disable         = no
}

3.建立資料夾

sudo mkdir ~/tftp
sudo chmod -R 777 ~/tftp
sudo chown -R nobody ~/tftp

4.sudo service xinetd restart

5.測試tufts get file都會Error Code 2: Access violation

將/etc/xinetd.d/tftp 改成如下即可 ==

service tftp
{
    protocol        = udp
    port            = 69
    socket_type     = dgram
    wait            = yes
    user            = nobody
    server          = /usr/sbin/in.tftpd
    server_args     = /home/jim.hsu/tftp
    disable         = no
}

2016年3月4日 星期五

LuCI (Lua Configiration Interface)

  • LuCI (Lua Configiration Interface) 是 OpenWRT 的 Web 管理介面。

  • LuCI 是一個 MVC framework,所以我們可以在 LuCI 的基礎上寫 Web 的應用程式。

  • OpenWRT management flow:   
  • official reference:



2015年10月30日 星期五

[Tool] 將 PDF 轉換為 PowerPoint


付費的官方解法 - Adobe Acrobat DC

網路上有不少免費的web版轉換工具,但很多轉出來都跑版或是一片空白

smallpdf目前測試正常








2015年9月3日 星期四

Google Cloud Platform V.S AWS



價格試算:

Amazon Web Service:

Google Cloud Platform:


IO PK:

By the numbers: How Google Compute Engine stacks up to Amazon EC2


價格PK:

Google vs. AWS Pricing: Google Cuts Are First of 2015


網路速度PK

Need for speed: Testing the networking performance of the top 4 cloud providers

Amazon EC2 vs Azure vs Rackspace Cloud vs Google C. Engine | Some tests and stats


總結:


  • Google Cloud在大優點是在台灣有機房,相比AWS東京,ping大勝
  • Google在價格上有優勢
  • AWS在產品完整度上Google目前還不能比
以新創、低需求、低成本來考慮的話,Google或許是個好選擇?



2015年6月8日 星期一

joomla 移除url中的index.php



1.系統->全站設定->網站設定->使用網址重寫(URL rewrite)選擇Yes



2.將joomla站點根目錄下的htaccess .txt文件重命名為.htaccess


2015年6月3日 星期三

[轉貼]2015 5月 android 版本市佔率


統計期間: 2015/5/26~2015/06/01

VersionCodenameAPIDistribution
2.2Froyo80.3%
2.3.3 -
2.3.7
Gingerbread105.6%
4.0.3 -
4.0.4
Ice Cream Sandwich155.1%
4.1.xJelly Bean1614.7%
4.2.x1717.5%
4.3185.2%
4.4KitKat1939.2%
5.0Lollipop2111.6%
5.1220.8%












資料來源:

2015年5月19日 星期二

linux sync指令


Linux 系統中,為了加快資料的讀取速度,寫入硬盤的資料有的時候為了效能,會寫到 filesystem buffer 中,這個 buffer 是一塊記憶體空間,如果欲寫入硬碟的資料存此 buffer 中,而系統又突然斷電的話,那資料就會流失!


  • 可以透sync 指令,將存 buffer 中的資料強制寫入disk中;


Name

sync - synchronize data on disk with memory

Synopsis

sync [--help] [--version]

Description

 sync writes any data buffered in memory out to disk. This can include (but is not limited to) modified superblocks, modified inodes, and delayed reads and writes. This must be implemented by the kernel; The sync program does nothing but exercise the sync system call.
The kernel keeps data in memory to avoid doing (relatively slow) disk reads and writes. This improves performance, but if the computer crashes, data may be lost or the file system corrupted as a result. sync ensures that everything in memory is written to disk.

sync should be called before the processor is halted in an unusual manner (e.g., before causing a kernel panic when debugging new kernel code). In general, the processor should be halted using the shutdown or reboot or halt commands, which will attempt to put the system in a quiescent state before calling sync.




  • 或是在程式中利用sync() function ;


Name

sync - commit buffer cache to disk

Synopsis

#include <unistd.h>

void sync(void);

Feature Test Macro Requirements for glibc

sync():
_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED


Description

sync() causes all buffered modifications to file metadata and data to be written to the underlying file systems.

Errors

sync() is always successful.


資料來源:
sync(2) - Linux man page
sync(8) - Linux man page