Posts

Showing posts from 2016

osmc use tips

Display Chinese fonts Under Settings -> Apperance -> Sking, set the font to be "Arial". Reference Play .m3u8 files Put it in a text file and rename the file extenstion to .strm. Browse to it in your video library and click on it. Reference  Or you set up a .m3u files as follows: http://kodi.wiki/view/Internet_video_and_audio_streams https://en.wikipedia.org/wiki/M3U Edit RSS feeds The RSS ticker can be toggled on or off by going to Settings -> Appearance -> Skin -> Show RSS news feed. See http://kodi.wiki/view/RSS_ticker for details. See http://kodi.wiki/view/Userdata for RssFeeds.xml location. For Linux, it is ~/.kodi/userdata/ with osmc/osmc as credential. Sample xml format:   http://feeds.feedburner.com/Tacos   See http://kodi.wiki/view/RssFeeds.xml for xml file format.

Higan emulator essential use note

Play GBA games with higan Higan expects a GBA BIOS to run GBA games. You may grab an open-source one from TempGBA. Its source code in github has the Normmatt's open-source GBA BIOS replacement in its bios/ folder. Rename the file to bios.rom and put it under Game Boy Advanced.sys/ folder of higan.

Mednafen emulator essential use note

Set up BIOS For a few game system (e.g. PC Engine/Turbo Grafx, Sega Saturn and PlayStation 1), one needs to provide appropriate BIOS files. First, locate the firmware/ folder. If you use the zipped windows distribution, the folder is right under the folder where you extract the zip file. If you use Ubuntu, the folder is under $HOME/.mednafen . Sega Saturn  Put the appropriate BIOS files into the firmware/ folder. sega_101.bin -- for Japan-region games mpr-17933.bin -- for North America/Europe-region games PlayStation 1 Put the appropriate BIOS files into the firmware/ folder. scph5500.bin  - (NTSC-J) Required for Japan-region games. scph5501.bin   - (NTSC-U) Required for North America/US-region games. scph5502.bin  - (PAL) Required for Europe-region games.  To change the name of the BIOS files, edit the following highlighted field in mednafen-*.cfg accordingly. ;Path to the Europe SCPH-5502/v3.0E ROM BIOS psx.bios_eu scph5502.bin ;Path to the Japan S

Movie extraction and editing software

YoutubeDLG: for downloading HD video from youtube. Avidemux Open the software. Drag the movie to the software window. In video output, choose "Mega AVC (h.264). In Audio output, choose "AAC (lav)". In the slide, use the slider and the "A" and "B" icon to select the segment that you want. Click on the Floppy disk button to save the segment. If you need to crop your video, select from the main menu, Video -> Filters -> Crop.

iptables pocket reference

iptables -L lists all rules  iptables -S [chain] shows the commands that build the rules of the chain. iptables -D [rule index or rule details] deletes a particular chain. NAT iptables -L -t nat lists all NAT rules. Replace source private IP to a public one, then when reply comes back, replace the associated destination public IP back to the private one. iptables -t nat -A POSTROUTING -s 192.168.128.4 -j SNAT --to-source 10.247.65.43 iptables -t nat -A PREROUTNG -d 10.247.65.43/32 -j DNAT --to-destination 192.168.128.4 Replacing rules iptables -R INPUT 1 -p tcp -s 192.168.0.0/24 --dport 80 -j ACCEPT Save modified iptables service iptables save Reference Reference 2

Hong Kong media HD stream direct links

You can use VLC player to play these links directly. RTHK Radio 1:  http://rthkaudio1-lh.akamaihd.net/i/radio1_1@355864/master.m3u8 Radio 2:  http://rthkaudio2-lh.akamaihd.net/i/radio2_1@355865/master.m3u8 Radio 3:  http://rthkaudio3-lh.akamaihd.net/i/radio3_1@355866/master.m3u8 Radio 4:  http://rthkaudio4-lh.akamaihd.net/i/radio4_1@355867/master.m3u8 Radio 5:  http://rthkaudio5-lh.akamaihd.net/i/radio5_1@355868/master.m3u8 Radio PTH:  http://rthkaudio6-lh.akamaihd.net/i/radiopth_1@355869/master.m3u8 DAB 31:  http://rthkaudio7-lh.akamaihd.net/i/dab31_1@355870/master.m3u8 DAB 32:  http://rthkaudio8-lh.akamaihd.net/i/dab33_1@355871/master.m3u8 DAB 35:  http://rthkaudio9-lh.akamaihd.net/i/dab35_1@355872/master.m3u8 TV31:  http://rthklive1-lh.akamaihd.net/i/rthk31_1@167495/index_2052_av-b.m3u8 TV32:  http://rthklive2-lh.akamaihd.net/i/rthk32_1@168450/index_2052_av-b.m3u8 References https://sites.google.com/site/moberadio/

Use squid to track http requests of machines in your LAN

The key is to set up a squid server on a Linux machine, and then have other machines use that squid server as the network proxy. Procedures (for squid installed on Ubuntu) sudo apt-get install squid3 Edit /etc/squid/squid.conf . Make sure you have uncomment the following acl lines: acl localhost src 127.0.0.1/32 acl localnet src 192.168.2.0/24 (Replace 192.168.2.0/24 with the subnet of your LAN)  Make sure you have uncomment the following http_access lines: http_access allow localnet http_access allow localhost service squid restart . By default the server uses port 3128. Set other machines to use that squid3 server as the network proxy. Browse /var/log/squid/access.log to check the http requests. To make your proxy server cache nothing, follow the instruction at here . For instance, add the following line in /etc/squid/squid.conf . cache deny all

MegaCli/MegaCli tutorial: Key Concepts and Basic Operations

Basic concepts The basic unit is a physical disk. Each disk can be identified by its enclosure ID and slot number. Multiple physical disks may be grouped to form a logical disk. Each such disk can be identified by its device id , and has its own RAID level . The logical disks are managed by adapters.   The first thing to do is to find how the logical and physical disks are arranged. Show all logical disks: MegaCli64 -LDInfo -LALL -aALL Show all physical disks: MegaCli64 -PDList -aALL Show the hierarchy of logical and physical disks managed by different adapters: MegaCli64 -LdPdInfo -aALL The possible RAID level are: [Primary-0, Secondary-0, RAID Level Qualifier-0] = RAID-0 [Primary-1, Secondary-0, RAID Level Qualifier-0] = RAID-1 [Primary-5, Secondary-0, RAID Level Qualifier-3] = RAID-5 [Primary-6, Secondary-0, RAID Level Qualifier-3] = RAID-6 [Primary-1, Secondary-3, RAID Level Qualifier-0] = RAID-10 Basic operations Remove/Add physical disks/logical disks

Bash: Run a command stored in a variable

$ cmd = "echo foo{bar,baz}" $ $cmd foo { bar , baz } $ eval "$cmd" foobar foobaz Reference

Download Youtube videos using ad-free open source VLC media player

Image
Here I record an ad-free, open source solution to downloading youtube videos using VLC media player. The player is available in virtually all common operating systems such as Windows, Mac and Linux and can be downloaded here . Step 1: Use your web browser to locate on the youtube website the video that you want to download. Copy the link. For example: https://www.youtube.com/watch?v=lN-GUBIMDNA Step 2: Start VLC player. From the main menu, select "Media" -> "Open network stream". Paste the link in step 1 to the textbox and click on the Play button. Step 3: From the main menu, select Tools -> Codec information. Step 4: In the subsequent window, copy the text inside the location field. That is the link to the video file. Step 5: Paste the link to your web browser. Right click on the video and then select "Save Video As"/"Save As" to save the video file. Reference NOTE: There is an even simpler way to download youtub

Set up Genymotion Android with Google service

Install Genymotion 2.6.0 Start Genymotion. Download the device image Google Nexus 5X - 6.0.0 - API 23 - 1080x1920. Start the device image in Genymotion. Download Genymotion-ARM-Translation_v1.1.zip . Drag it to the screen of the started VM to flash it. Restart. Use the same procedure to flash gapps-L-4-21-15.zip .  Sign in into your google account by starting the gmail app for instance. Flash benzo-gapps-M-20151011-signed-chroma-r3.zip and restart. Reference: https://gist.github.com/wbroek/9321145

Docker quick start (Firefox container as an example)

Below are the minimal commands needed to get a working Mozilla Firefox docker container in Ubuntu. Install docker client and server sudo apt-get install docker.io Allow the docker user to communicate with your X session xhost +local:docker Download a Firefox docker image and start it as a container sudo docker run -v $HOME/Downloads:/home/firefox/Downloads:.rw -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox Once the image has been downloaded, it can be started with the following command instead: sudo docker r un -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev/snd:/dev/snd --privileged -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name firefox chrisdaish/firefox Note the id or name of the container. Later if you want to get back to the container, you need that id. sudo docker attach [id or name] sudo docker start [id or name> Before you can run again,

Time change due to Windows-Ubuntu dual boot

This happens because Windows thinks the hardware clock tracks local time, while Ubuntu thinks the clock tracks UTC. If the time is reset in Ubuntu, the time would be wrong in Windows. A good solution is to set Ubuntu to treat the hardware clock as local time. For older systems, edit /etc/default/rcS as root and make sure that UTC=no . For newer systems using systemd (15.04+), you shall run the following command. timedatectl set-local-rtc 1 Reference Reference 2