Skip to content

Instantly share code, notes, and snippets.

@vizv
vizv / Loader.cs
Created October 4, 2018 07:26
DumpAssembly module with example
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace DumpAssembly
{
class Loader
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct MonoImage
@vizv
vizv / whylinux.txt
Last active September 20, 2017 15:33
我们告诉人们用 Linux 是因为它很安全。或者因为它是免费的,因为它是可以定制的,因为它是自由的,因为它有一个强大的社区支持着……
但是上面的所有原因都是在扯淡。我们这么跟非 Linux 用户讲因为它们没法了解真正的原因。而且我们说多了这些借口,我们自己也开始这么相信了。
但是在我们内心深处,还保留着真正的原因。
我们用 Linux 因为它很有趣。
折腾你的系统很有趣。修改所有的设置,把系统搞挂,然后进入恢复模式去修复它很有趣。有上百个发行版供你选择很有趣。用命令行很有趣。
# viz-snapshot defaults file.
BTRFS_ROOT_DEV='/dev/mapper/root'
BTRFS_SUBVOLS='system/awesome-root data/awesome-home-viz'
@vizv
vizv / CentOS7ReleaseApproaching.md
Last active August 29, 2015 14:03
CentOS 7 Release Approaching

CentOS 7 发布在即!

CentOS 作为一个受欢迎的红帽企业级 Linux (RHEL) 的衍生版,即将在近期发布!

前些日子(6月10日),万众瞩目的 [RHEL7 发布并提供用户下载][1]。 也就是说,其免费的自由衍生版本 CentOS 7 也将在不远的将来发布。

起先,CentOS 软件工程师 [Johnny Hughes][2] 于6月11日在 CentOS 7 的官方博客的[一篇回复][3]中提到

Our “Goal” is 2-4 weeks.

@vizv
vizv / upgrade_gitlab_hq.sh
Created May 13, 2014 15:24
Update Scripts for GitLab
#!/bin/bash
cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \
sudo service gitlab stop; sudo -u git -H ruby script/upgrade.rb -y; sudo service gitlab start; \
sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
@vizv
vizv / vsh.c
Last active September 24, 2017 05:25
vsh (VShell)
/*
* File: a1p1.c
* Author: Wenxuan Zhao 100108743
* Date: 2013/01/22
* Version: 1.0
*
* Purpose: vsh (V-Shell) first implementation! include only buildin function
* `exit`...
* TODO: > Simplify the error output message
* > Modulize the codes
@vizv
vizv / water.js
Created April 23, 2012 10:18
created by water, a live-coding editor (http://water.gabrielflor.it)
// chord diagram from http://mbostock.github.com/d3/ex/chord.html
// colors from the twilight theme: http://bit.ly/wufWv1
var chord = d3.layout.chord()
.padding(0.05)
.sortSubgroups(d3.descending)
.matrix([
[9798, 5871, 8916, 2868],
[ 1951, 10048, 2060, 6171],