Skip to content

Instantly share code, notes, and snippets.

View cy20lin's full-sized avatar
🙂

Chien-Yu Lin cy20lin

🙂
View GitHub Profile
@cy20lin
cy20lin / DellXPS15_9560_AHCI_RAID.md
Created January 26, 2019 03:22 — forked from chenxiaolong/DellXPS15_9560_AHCI_RAID.md
Switching between AHCI and RAID on the Dell XPS 15 (9560)

Switching between AHCI and RAID on the Dell XPS 15 (9560)

This guide likely applies to other models and, potentially, even laptops from other OEMs that have NVME drives. However, I've only tested this on my Dell XPS 15 (9560) with the OEM Windows installation from the Signature Edition model.

Switching from RAID to AHCI

Switching from RAID to AHCI is significantly simpler than switching from AHCI to RAID. All that's needed is a successful boot to Safe Mode.

  1. To set the default boot mode to Safe Mode, use msconfig.exe or open an admin cmd/PowerShell window and run:
@cy20lin
cy20lin / enable vt-x in chromebook
Created October 8, 2018 14:39 — forked from komuw/enable vt-x in chromebook
How To enable VT-x support in chromebook
Generously taken from this discussion; https://github.com/dnschneid/crouton/issues/675
They've created a wiki: https://github.com/dnschneid/crouton/wiki/Repack-kernel-to-Enable-VT_x-for-Virtualbox
You should check it out to see if anything has changed.
A. first of all install virtualbox correctly: https://gist.github.com/komuW/10991598. then;
1.Open a shell on your Chrome OS
ie while in in chromeOS; open browser, then ctrl+alt+T, then type shell, then press enter
2.Disable verified boot :
@cy20lin
cy20lin / WA2-Ubuntu.md
Created August 31, 2018 18:15 — forked from ObserverOfTime/WA2-Ubuntu.md
Install and patch White Album 2 on Linux

For Ubuntu and other Debian-based distros

You can fork this gist and add instructions for your own distro and I'll link them below.

1: Enable Japanese Locale

Check whether it's already enabled:

$ locale -a | grep ja
@cy20lin
cy20lin / Install NVIDIA Driver and CUDA.md
Created August 9, 2018 17:14 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@cy20lin
cy20lin / stdin_stream.hpp
Created June 26, 2018 06:28 — forked from kikairoya/stdin_stream.hpp
boost::asio AsyncReadStream for console input
class stdin_stream: boost::noncopyable {
typedef boost::function<void (const boost::system::error_code &, size_t bytes_transferred)> read_handler_type;
public:
stdin_stream(boost::asio::io_service &io, HANDLE hin): io(io), hin(hin), hev(CreateEvent(0, 0, 0, 0)), handler(), buffer(0), size(0) {
_beginthread(&stdin_stream::thread_handler_gateway, 0, this);
}
~stdin_stream() {
buffer = 0;
CloseHandle(hev);
}
@cy20lin
cy20lin / install-tensorflow.md
Created May 31, 2018 23:06 — forked from vellamike/install-tensorflow.md
Install tensorflow on Jetson TX2 (Jetpack 3.2)

Building TensorFlow from source for Jetson TX2 with Jetpack 3.2

Jetpack 3.2 includes Cuda 9 and CuDNN 7 so it is necessary to compile it from source.

Step 1 - Get Java

sudo apt-get install openjdk-8-jdk

Step 2 - Get some dependencies

@cy20lin
cy20lin / bignum_dec2hex.cmake
Created November 2, 2017 15:30
Convert any big number form decimal to hexadecimal using CMake scripting language
## bignum_dec2hex.cmake --- Convert any bignum form dec to hex
##
## Copyright (c) 2017 ChienYu Lin
##
## Author: ChienYu Lin <cy20lin@gmail.com>
## License: MIT
##
function(bignum_divide in_dividend in_divisor out_quotient out_remainder)
set(r "")
@cy20lin
cy20lin / Hybrid.bat
Created July 20, 2017 12:21 — forked from davidruhmann/Hybrid.bat
[Batch] JScript and Batch Hybrid
@if (@CodeSection == @Batch) @then
:: The first line above is...
:: in Batch, a valid IF command that does nothing.
:: in JScript, a conditional compilation IF statement that is false.
:: So the following section is omitted until the next "[at]end".
:: Note: the "[at]then" does nothing and is only for readablility.
:: Batch Section
@cy20lin
cy20lin / base64.sh
Created June 27, 2017 08:26 — forked from markusfisch/base64.sh
base64 fallback implementation in bash
#!/bin/bash
# Fallback base64 en-/decoder for systems that lack a native implementation
#
# @param ... - flags
which base64 &>/dev/null || {
# if even od is missing
which od &>/dev/null || od()
{
local C O=0 W=16