Skip to content

Instantly share code, notes, and snippets.

View nyanshell's full-sized avatar
🐈

Gestalt LUR nyanshell

🐈
View GitHub Profile
@nyanshell
nyanshell / update_motd.service
Created August 3, 2014 11:39
archlinux update /etc/motd with systemd
[Unit]
Description=Update motd
After=sshdgenkeys.service
[Service]
ExecStart=
ExecStart=/usr/bin/update_motd.sh
Restart=always
[Install]
@nyanshell
nyanshell / .emacs
Created March 16, 2023 10:17
emacs rime config
(use-package rime
:custom
(rime-librime-root "/home/flandre/.emacs.d/librime/build")
;; (rime-librime-root (expand-file-name "librime/build" user-emacs-directory))
(default-input-method "rime")
:bind
(:map rime-mode-map
("C-`" . 'rime-send-keybinding)))
;; :config
;; (define-key rime-active-mode-map (kbd "C-2") 'rime-s2t)
@nyanshell
nyanshell / keepalive.py
Last active July 6, 2022 04:58
twitter-ak-keepalive
import os
from requests_oauthlib import OAuth1Session
API_KEY = os.getenv('API_KEY')
API_SECRET = os.getenv('API_SECRET')
def keep_alive():
oauth = OAuth1Session(client_key, client_secret=client_secret)
user_info = oauth.get('https://api.twitter.com/1.1/users/show.json', params={'screen_name': 'twitter'})
#!/bin/bash
# location: /usr/local/share/login_notify.sh
# /etc/pam.d/sshd
# add optional pam_exec.so /usr/local/share/login_notify.sh
function post_to_slack () {
# format message as a code block ```${msg}```
SLACK_MESSAGE="\`\`\`$1\`\`\`"
new ssh-login channel
https://hooks.slack.com/services/<channel-url>

Keybase proof

I hereby claim:

  • I am nyanshell on github.
  • I am geshtalt (https://keybase.io/geshtalt) on keybase.
  • I have a public key whose fingerprint is 1D8E 5678 D278 DC60 2401 0E05 8197 1AC8 6B2A A7A1

To claim this, I am signing this object:

@nyanshell
nyanshell / README.md
Last active June 8, 2019 08:10
gpu_tf_bench

environment

NVIDIA

i7-6700k
ASUS GTX 1080 8G
CUDA 9 CUDNN 7
python 3.6.6
tensorflow 1.12.0
@nyanshell
nyanshell / id3.py
Last active December 17, 2017 15:42
A Naive Decision Tree Practice, only for discrete values (ID3 algorithm)
# -*- coding: utf-8 -*--
"""
A Naive Decision Tree Practice, Only for discrete values
ID3 algorithm
"""
import math
import copy
from collections import defaultdict
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "test" do |config|
config.vm.hostname = "test"
config.vm.box = "bento/ubuntu-16.04"
config.vm.network "private_network", type: "dhcp"
config.vm.provider "virtualbox" do |vb|
@nyanshell
nyanshell / README.md
Created April 27, 2016 17:07
dnn practice
@nyanshell
nyanshell / .vimrc
Created August 7, 2015 03:48
vim config
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" " alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
"
" " let Vundle manage Vundle, required