Skip to content

Instantly share code, notes, and snippets.

View diyism's full-sized avatar

Malcolm Ke Win diyism

View GitHub Profile
@diyism
diyism / 上海医院haodf.com在线医生数排名
Created October 18, 2013 08:38
上海医院haodf.com在线医生数排名
仁济医院 (科室 53 个, 大夫 760 人) 277位大夫在线
第九人民医院 (科室 47 个, 大夫 581 人) 269位大夫在线
新华医院 (科室 60 个, 大夫 681 人) 266位大夫在线
瑞金医院 (科室 44 个, 大夫 738 人) 247位大夫在线
华山医院 (科室 45 个, 大夫 686 人) 246位大夫在线
长海医院 (科室 47 个, 大夫 487 人) 218位大夫在线
第一人民医院 (科室 43 个, 大夫 548 人) 210位大夫在线
长征医院 (科室 37 个, 大夫 379 人) 198位大夫在线
第十人民医院 (科室 42 个, 大夫 399 人) 195位大夫在线
东方医院 (科室 52 个, 大夫 348 人) 180位大夫在线
@diyism
diyism / bigger_checkbox.htm.txt
Created November 1, 2013 10:52
即使手机浏览器里都没法用css直接变大checkbox本身,改变宽高没用,只能用":before"插入一个更大inline-block白背景黑框盖住checkbox,再插入对钩字符的办法
<style>
input[type=checkbox] {width:25px;}
input[type=checkbox]:before
{content:"";
display: inline-block;
width: 25px;
height: 25px;
border:1px solid black;
background-color:white;
}
@diyism
diyism / javascript_bookmarklet.html
Created November 1, 2013 10:57
javascript bookmarklet.html
<script>window.open("javascript:s=document.createElement('scr'+'ipt');s.setAttribute('onload', '$.ajax({url:\"http://192.168.0.1/index.php?action=get_todos\",type:\"POST\",success:function(json){json=eval(\"(\"+json+\")\");console.log(json);}});');s.src='http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js';document.body.appendChild(s);");</script>
@diyism
diyism / software alternative for linux.md
Last active January 25, 2023 00:27
software alternative for linux,migrating from windows to linux
  1. DOS usb boot -> ubuntu live iso usb boot(too big), minimal_linux_live_20-Jan-2017_64-bit.iso(only 6.8MB)
  2. diskgenius for dos -> testdisk("No Log\Proceed\Intel\Analyse\Quick Search", better than fdisk), gnome-disks
  3. norton ghost for dos -> "fsarchiver savefs" "fsarchiver restfs", remastersys
  4. windows xp -> debian+de(lxde, xfce), kali, ubuntu
  5. ntldr boot.ini -> grub menu.lst, boot-repair
  6. RemapKey/KeyTweak -> xmodmap -pke > ~/.Xmodmap then modify it, it will be loaded automatically
  7. myboard.exe -> myboard.py + modified xorg-server + modified libgtk2.0-0 + fcitx-googlepinyin
  8. MagicMover(D:\Program Files) -> remastersys restored sda1 + UnionFS-FUSE(pivot_root) sda2
  9. WinHex -> wxHexEditor, bless, (sublime hexviewer only can edit one line)
  10. emEditor(PHP/C braces outline, csv editor) -> sublime(ctrl+r to list functions, addon packages: AlignTab,SublimeCodeIntel,Codecs,ConvertToUTF8), SciTE(to view log files)
@diyism
diyism / hacked apple g6 european keyboard keymap for ubuntu
Last active December 28, 2015 09:39
hacked apple g6 european keyboard keymap for ubuntu
======================要随ubuntu系统启动, 放在/home/<user>/.Xmodmap=====================
clear lock
clear shift
clear mod4
keycode 8 =
keycode 10 = Escape NoSymbol Escape
keycode 11 = 1 exclam 1 exclam
keycode 12 = 2 at 2 at
keycode 13 = 3 numbersign 3 numbersign
keycode 14 = 4 dollar 4 dollar
@diyism
diyism / .Xmodmap
Last active December 28, 2015 10:18
hacked apple g6 european keyboard keymap for ubuntu xmodmap.dump.new.for_xwindow.rename_to ~/.Xmodmap result: http://www.diyism.com/hardware/$keyboard/apple_g6_pro_euro.png
clear lock
clear shift
clear mod4
keycode 8 =
keycode 10 = Escape NoSymbol Escape
keycode 11 = 1 exclam 1 exclam
keycode 12 = 2 at 2 at
keycode 13 = 3 numbersign 3 numbersign
keycode 14 = 4 dollar 4 dollar
keycode 15 = 5 percent 5 percent
@diyism
diyism / replace dnsmasq-base with unbound.txt
Last active March 4, 2022 21:19
replace dnsmasq-base with unbound
#remove dnsmasq-base without removing network-manager, don't use "apt-get remove"
#but apt-get will be held, so need no do this line
sudo dpkg --remove --force-all dnsmasq-base
#kill dnsmasq to release the port 53
sudo kill -SIGHUP $(cat /var/run/dnsmasq/dnsmasq.pid)
#confirm /etc/resolv.conf is:
nameserver 127.0.0.1
@diyism
diyism / boot procedure of RCs.txt
Last active December 29, 2015 12:59
linux/ubuntu启动顺次有10种脚本,分5批:123(rc*.d,crontab,rc.local),4(session-setup-script),567(environment,profile,.profile),8(autostart),9,10(bash.bashrc,.bashrc)
boot procedure of RCs:
1./etc/rc*.d/S*
"rc" means "run commands"
run command as root
for example:/etc/init.d/unbound linked as /etc/rc[2-5].d/S20unbound and /etc/rc[0,1,6].d/K20unbound
2./etc/crontab
"@reboot root <command>"
3./etc/rc.local
run command as root
@diyism
diyism / session-setup-script.sh
Last active October 17, 2019 00:07
linux系统和应用目录都交错在一起了,用unionfs-fuse和pivot_root才能隔离,随系统启动:session-setup-script=session-setup-script.sh in /etc/lightdm/lightdm.conf @_:…boot+lib+(usr/)sbin+bin对SYS区,usr/(bin+lib+share)对APP区,etc+var公用
=================================pc lubuntu上, 2013年===========================================
#!/bin/sh
#chroot only for root user session
#pivot_root for whole system root directory changing
#sudo su
#mkdir /mnt/new_root #must be 755 root:root, or else sudo won't work: unable to stat /etc/sudoers: Permission denied
#mkdir /mnt/root #must be 755 root:root
#mkdir /mnt/rw #must be 755 root:root
@diyism
diyism / session-cleanup-script.sh
Last active September 29, 2018 02:07
对应启动时pivot_root(放在session-setup-script=session-setup-script.sh in /etc/lightdm/lightdm.conf) 关机时还要reverse pivot_root(放在session-cleanup-script=session-cleanup-script.sh) 否则不能正常关机,或导致磁盘was not cleanly unmounted
#!/bin/sh
/sbin/pivot_root /old_root /old_root/mnt/new_root #reverse pivot root, or else sys won't shutdown and disk won't be cleanly unmounted
exit 0 #return success