Category: Opensource

  • Play a bit Kubernetes with Minikube

    I’ve just played a bit Kubernetes on my Arch Linux laptop, with Minikube. It’s easier than I thought. Since I’ve already installed VirtualBox from the start, I can use minikube right after I installed it with curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ The command I used to start […]

  • Mining ZCash on Ubuntu Linux

    I didn’t quite believe that mining crypto currencies is viable as an individual, until I saw the news that AMD graphics cards were sold out because they’re good at mining Ethereum. To be convinced I tried to order AMD RX 570 from some online vendors, and they all cancelled my orders and refunded me shortly. […]

  • Linux and Wake on LAN

    The Internet servers are usually on 24×7, probably that’s why I never had the need to use the Wake on LAN feature on a computer. I’ve just built a home server running Ubuntu Linux, using consumer grade PC parts. To avoid a big surge on my next electricity bill, I plan to only turn on […]

  • Install Fluentd with Ansible

    Fluentd has become the popular open source log aggregration framework for a while. I’ll try to give it a spin with Ansible. There are quite some existing Ansible playbooks to install Fluentd out there, but I would like to do it from scratch just to understand how it works. From the installation guide page, I […]

  • Saving Images in Chrome with Selenium

    Here’s how to save images in Chrome browser using Selenium. The API has element.screenshot_as_png() method but apparently it’s not implemented at the moment. With some minor changes to this answer I can save a image via the browser: 🙂

  • Change Ganeti's Network Configuration

    “Ganeti is a cluster virtual server management software tool built on top of existing virtualization technologies such as Xen or KVM and other open source software. ” This is how I changed the secondary network configuration using Ganeti command line tools. 1, First, say I need to change the network from 10.0.0.0/24 to 10.1.0.0/16, I […]

  • MySQL VS. MariaDB 之日期格式差异

    MariaDB Foundation 号称 MariaDB 是 MySQL 的替代品, 但我发现它们之间还是有些不兼容的地方(而且不在已列出的清单里). MariaDB 似乎对日期格式要求更为严格. 以下 SQL 的执行结果就很有不同, 在 MySQL 中 changed_at 是正常的 datetime, 但是在 MariaDB 中 changed_at 完全是 ‘0000-00-00 00:00:00’ 的样子. INSERT INTO … SELECT … GREATEST( COALESCE(`inspection`.`ts`, 0), COALESCE(`inspection_details`.`ts`, 0), COALESCE(`open_time_reason`.`ts`, 0) ) AS `changed_at` ON DUPLICATE KEY UPDATE … `changed_at` = VALUES(`changed_at`) 解决方法是添加一个明确的格式转换: CONVERT(… , DATETIME) CONVERT( […]

  • 土法制造 DDNS 完整版

    节日快乐! 最近我又对之前的脚本完善了一下, 添加了对 CloudFlare DNS API 的呼叫, 这样 DDNS 才名副其实吧: #!/bin/bash function update_dns { logger ‘Prepare to update DNS…’ curl -i https://www.cloudflare.com/api_json.html \ -d ‘a=rec_edit’ \ -d ‘id=DOMAIN_ID’ \ -d ‘tkn=THIS_IS_MY_KEY_GO_GET_YOURS’ \ -d ’email=MY_EMAIL’ \ -d ‘z=raynix.info’ \ -d “content=$1” \ -d ‘type=A’ \ -d ‘name=XXX’ \ -d ‘ttl=1′ |logger } url=’http://direct.raynix.info/ip.php’ last=’/tmp/extip’ rcpt=’MY_EMAIL’ extip=`curl […]