Skip to content

Instantly share code, notes, and snippets.

@crosstyan
crosstyan / Dockerfile
Last active December 21, 2022 07:23
fxxk Nvidia
# https://stackoverflow.com/questions/72179923/docker-run-without-entry-point
FROM nvidia/cuda:11.6.2-devel-ubuntu20.04
ENV TZ=Asia/Shanghai
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "export LANG=C.UTF-8" >>/etc/profile \
&& apt-get update \
&& apt-get install vim openssh-server iputils-ping wget curl -y \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config \
&& echo "root:114514" | chpasswd
RUN apt install -y git tmux build-essential \
@xiaolai
xiaolai / jupyter-as-a-desktop-app.md
Last active September 15, 2023 08:37
Run Jupterlab as an desktop app

How to run Jupyterlab as a desktop app on Mac OSX

In Sep, 2021, Jupyterlab Desktop App (electron) was released by Mehmet Bektas (github repo).

brew install --cask jupyterlab

jupyterlab-app-first-opened

@mysteriouss
mysteriouss / weixin_tiaotiao.js
Created January 1, 2018 07:49
weixin_tiaotiao
// ==UserScript==
// @name weixin_tiaotiao
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mp.weixin.qq.com/
// @grant GM_xmlhttpRequest
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js
// @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/aes.js
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@ovrmrw
ovrmrw / Program.cs
Last active September 28, 2021 14:25
Topshelf + OWIN Self-Host + ASP.NET WebAPI + Ninject
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Tracing;
using System.Reflection;
using Owin;
@aa65535
aa65535 / aria2.bat
Last active February 7, 2024 05:41
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@bitplus
bitplus / server_certificates_to_pem.md
Created July 4, 2012 07:02 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@ninehills
ninehills / wr703n-openwrt.md
Last active December 9, 2022 13:37
WR703N OpenWrt 配置流程

WR703N OpenWrt 配置流程

下载安装

访问WR703N在OpenWrt的[Wiki页][wr703n-openwrt],然后在Flashing一节中找到下载链接:[squashfs-factory.bin][flash.bin],下载后别忘了[比对md5][md5sum]。[1]

进入路由器管理界面,出厂配置为http://192.168.1.1,用户名和密码均为admin,然后进入固件更新,选择下载的文件,然后更新。

@kevintop
kevintop / 12306AutoLogin.user.js
Created January 6, 2012 15:05
12306 Auto Login
/*
12306 Auto Login => A javascript snippet to help you auto login 12306.com.
Copyright (C) 2011 Kevintop
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes 12306.user.js
@quietlynn
quietlynn / 12306.user.js
Created January 3, 2012 12:01
12306 Auto Query => A javascript snippet to help you book ticket
/*
12306 Auto Query => A javascript snippet to help you book tickets online.
Copyright (C) 2011-2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js