Skip to content

Instantly share code, notes, and snippets.

@dlintw
dlintw / setup_r_in_arch.sh
Created January 9, 2017 01:08
setup R in Arch Linux
yaourt -S gcc-fortran # for compile related functions
yaourt -S revomath microsoft-r-open # faster version
yaourt -S r # or offical version
yaourt -S rstudio-desktop-bin # optional code editor desktop
# ref: https://support.rstudio.com/hc/en-us/articles/205605748-Using-RStudio-0-99-with-Fctix-on-Linux
ln -s /usr/lib/qt/plugins/platforminputcontexts/libgcinplatforminputcontextplugin.so \
/usr/lib/rstudio/bin/plugins/platforminputcontexts
@dlintw
dlintw / shpkg.conf
Created January 7, 2017 06:23
sample modification for /etc/shpkg.conf after google archive the files
# config file for all support repository
st24 rpm https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/sh4twbox \
http://ftp.stlinux.com/pub/stlinux/2.4/STLinux/sh4 \
http://ftp.stlinux.com/pub/stlinux/2.4/updates/RPMS/sh4
@dlintw
dlintw / 剪刀石頭布.jl
Last active July 24, 2021 15:43
我的第一隻 Julia 小遊戲
# Julia 剪刀石頭布
# 1. 變數可用中文
# 2. 加上 try catch 錯誤處理
# 3. 加上多行註解 #= =#
# 4. 採用公式計算結果
"""
`input(prompt::AbstractString="")`
Read a string from STDIN. The trailing newline is stripped.
@dlintw
dlintw / sample_alloc.c
Created December 2, 2016 14:28
sample code for alloc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
unsigned int param_len;
char param[1]; /* variable size array - param_len bytes */
/* Up to 3 pad bytes follow here - to make the whole struct int aligned. */
} test_t;
@dlintw
dlintw / bvi.APKBUILD
Created April 11, 2016 13:48
APKBUILD of bvi
# Contributor: Daniel YC Lin <dlin@gmail.com>
# Maintainer: Daniel YC Lin <dlin@gmail.com>
pkgname=bvi
pkgver=1.4.0
pkgrel=0
pkgdesc="A display-oriented editor for binary files operate like 'vi' editor"
url="http://bvi.sourceforge.net"
arch="all"
license="GPL"
depends="ncurses"
@dlintw
dlintw / PKGBUILD.lstv
Created February 16, 2016 15:34
PKGBUILD for lstv
# Maintainer: Andy Crowd <andy_crowd@ainsdata.se>
pkgname=lstv
pkgver=0.0.2
pkgrel=1
pkgdesc="DVB channel selector for mplayer."
arch=(any)
depends=(mplayer)
source=("http://downloads.sourceforge.net/project/lstv/lstv-$pkgver.tar.gz")
optdepends=(w_scan)
license=('GPL')
@dlintw
dlintw / genymotionwithplay.txt
Last active August 30, 2015 14:36 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161892865 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
@dlintw
dlintw / root_xperia502.sh
Created August 29, 2015 09:41
script for root xperia 5.0.2 android
cat <<EOT
此root用於Xperia Z 5.0.2 [10.6.A.0.454]
僅發佈於apk.tw 請勿轉載
By cat1221 ,cat605101
Translate to Linux by dlintw
其他機型.版本未測試 盡量不要用在次外的版本
無法百分之百保證可以 但請按照指示行走 未完成請勿按下一步!
過程會用到KingRoot當跳板 但會清除乾淨 擔心者請勿使用
請先把手機拔離電腦 靜待指示
---------------------------------------------
@dlintw
dlintw / gist:4a289efb35cebae7396c
Created July 10, 2015 08:38
mouse fail on xbmc
NextVOD:~# usb 4-1: USB disconnect, address 2
usbmouse: can't resubmit intr, stm-ohci.1-1/input0, status -19
usb 4-1: new low speed USB device using stm-ohci and address 3
usb 4-1: configuration #1 chosen from 1 choice
input: Primax Icon7 Twister Evolution Laser Mouse as /devices/platform/stm-usb.1/stm-ohci.1/usb4/4-1/4-1:1.0/input/input2
usb 4-1: USB disconnect, address 3
usb 4-1: new low speed USB device using stm-ohci and address 4
usb 4-1: configuration #1 chosen from 1 choice
input: A4Tech USB Mouse as /devices/platform/stm-usb.1/stm-ohci.1/usb4/4-1/4-1:1.0/input/input3
@dlintw
dlintw / gist:96799f668c78ba34570d
Created July 9, 2015 21:59
xbmc sample uboot.sh
# uboot.sh - TWPDA UBOOT modification for setting boot parameters
# Read TWPDA UBOOT logic http://www.twpda.com/2013/08/uboot-code.html
# hush script syntax http://www.stlinux.com/u-boot/using
# boot settings for sh4twbox install disk
# * bootargs: root=8:1 means sda1, sda2 8:2, sdb1 8:17, sdb2 8:18
# * bootcmd: 0:1 first usb parition, 0:2 2nd usb parition
setenv bootargs 'console=ttyAS0,115200 rootdelay=0 root=/dev/sda2 rootfstype=ext4 rw rootflags=data=journal nwhwconf=device:eth0,hwaddr:10:08:E2:12:06:BD phyaddr:0,watchdog:5000 mem=256M bigphysarea=2048'
#setenv bootcmd 'usbcfg 0; usb start; usb info; usb part; ext2load usb 0:1 80000000 vmlinux.ub; bootm 80000000'