Skip to content

Instantly share code, notes, and snippets.

@lsgrep
lsgrep / discover-pci-slot-type-linux
Created July 16, 2017 05:12 — forked from antonioams/discover-pci-slot-type-linux
How to discover PCI Slot Type in a Linux Server
[root@local ~]# dmidecode | grep -A 5 "System Slot"
System Slot Information
Designation: PCI1
Type: x4 PCI Express Gen 2 x8
Current Usage: Available
Length: Long
Characteristics:
--
System Slot Information
Designation: PCI2
@lsgrep
lsgrep / go-ci-build.sh
Created July 18, 2017 07:56 — forked from wavded/go-ci-build.sh
Go Jenkins CI Script - golang
#!/bin/bash
# Go build script that runs cloc, cpd, lint, vet, test and coverage for Jenkins
#
# Outside tools include:
# gocov: go get github.com/axw/gocov
# gocov-xml: go get github.com/t-yuki/gocov-xml
# go2xunit: go get bitbucket.org/tebeka/go2xunit
# jscpd: npm i jscpd -g
# cloc: npm i cloc -g
git config --global credential.helper store
echo "https://${GITHUB_TOKEN}:x-oauth-basic@github.com" >> ~/.git-credentials
0xFc571a5fA85fd82393FbD3Ff9d74583a000C174c
@lsgrep
lsgrep / import_zone.py
Created August 15, 2017 03:12 — forked from onlytiancai/import_zone.py
从zonefile文件把域名记录导入到DNSPod
# -*- coding: utf-8 -*-
'''
功能:
从zonefile文件导入域名到Dnspod
requirements:
dnspython==1.10.0
requests==1.0.4
'''
@lsgrep
lsgrep / kubectl.fish
Created October 10, 2017 09:31 — forked from terlar/kubectl.fish
Kubernetes fish completions
# kubernetes - is an open source system for managing containerized
# applications across multiple hosts, providing basic mechanisms for
# deployment, maintenance, and scaling of applications.
# See: https://kubernetes.io
function __kubectl_no_command
set -l cmd (commandline -poc)
if not set -q cmd[2]
return 0
end
@lsgrep
lsgrep / Makefile
Created October 12, 2017 02:56 — forked from mcastilho/Makefile
Makefile for Medium article
.PHONY: all tags clean test build install generate image release
REGISTRY_REPO = <..redacted..>
OK_COLOR=\033[32;01m
NO_COLOR=\033[0m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
# Build Flags
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
# Enabling this option disables Stateless Address Autoconfiguration
# based on Router Advertisements for this host
net.ipv6.conf.all.forwarding=1
net.ipv4.conf.all.proxy_arp = 1
net.core.netdev_max_backlog = 250000
@lsgrep
lsgrep / readme.md
Last active September 25, 2019 15:29

whoami

I have been developing backend applications for the last few years. After reading Hackers & Painters I was captivated by the Lisp, to this day still am. And under the influence of Paul and Hacker News, I picked up Clojure, a Lisp on JVM. Not only because Lisp is an elegant, beautiful language, it is also one of the few languages that involved in the creation of the Artificial Intelligence. Alas, I never had the chance to use Lisp or other languages to build intelligent applications professionally.

@lsgrep
lsgrep / Tensorflow 1-2.md
Created October 20, 2019 11:44
Tensorflow 1-2.md

Tensorflow 1.0 vs Tensorflow 2.0

Tensorflow 1.0 in general is not famed for its ease of use, nor for being well documented. Tensorflow 2.0 has set out to fix all those issues, and it does make things easier with advent of eager execution and unified RNNs & unified Optimizers etc. There are a lot to take in version 2.0, but without proper context and comparison to the 1.0 version, some features are beyond magical. I will provide proper explanation and context through this blog.

Tensorflow 1.0 Programming model

  • Graph