Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Sanjeev snj33v

🏠
Working from home
View GitHub Profile
View install_nodexp.sh
useradd --no-create-home --shell /bin/false node_exporter
curl -fsSL https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz | tar -zxvf - -C /usr/local/bin --strip-components=1 node_exporter-1.0.1.linux-amd64/node_exporter; chown node_exporter:node_exporter /usr/local/bin/node_exporter
mkdir -p /etc/node_exporter /var/lib/node_exporter
sudo chown -R node_exporter:node_exporter /var/lib/node_exporter
sudo -u node_exporter openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout /var/lib/node_exporter/key.pem -out /var/lib/node_exporter/crt -subj "/C=BE/ST=Antwerp/L=Brasschaat/O=Inuits/CN=localhost"
echo -e "tls_server_config:\n cert_file: /var/lib/node_exporter/crt\n key_file: /var/lib/node_exporter/key.pem" > /etc/node_exporter/web.yml
sudo tee /etc/systemd/system/node_exporter.service <<"EOF"
[Unit]
Description=Node Exporter
View install_docker.sh
sudo apt-get remove -y docker docker-engine docker.io containerd runc
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get -y install docker-ce docker-ce-cli containerd.io
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
View sh.bash
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo gpasswd -a $USER docker
View mapview.jsx
class MapView extends React.Component {
constructor(props) {
super(props)
this.state = {
center: 0
}
}
static getDerivedStateFromProps (props, state) {
// both props.right and props.left are simple numerical values
let feat = props.right+ props.left
@snj33v
snj33v / launch.json
Created Apr 24, 2018
vscode chromium launch
View launch.json
{
"version": "0.2.0",
"configurations": [{
"name": "Chromium",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "/usr/bin/chromium",
"userDataDir": "/tmp/vscode-chrome-debug",
"runtimeArgs": [
"--temp-profile"
@snj33v
snj33v / settings.json
Last active Apr 24, 2018
vscode config
View settings.json
{
"window.menuBarVisibility": "toggle",
"telemetry.enableCrashReporter": true,
"telemetry.enableTelemetry": true,
"editor.fontFamily": "Fira Code",
"workbench.colorTheme": "Abyss",
"editor.fontLigatures": true,
"editor.fontSize": 16,
"editor.tabSize": 2,
"editor.insertSpaces": false,
View keybase.md

Keybase proof

I hereby claim:

  • I am snj33v on github.
  • I am snj33v (https://keybase.io/snj33v) on keybase.
  • I have a public key ASBJNtMbQFl7ND2cjXijTagGFLoMxbqVWMj1EZZ6Qu2v1Qo

To claim this, I am signing this object:

@snj33v
snj33v / .tern-project
Last active Jan 25, 2018
tern-project config for most of js projects
View .tern-project
{
"ecmaVersion": 6,
"libs": [
"browser",
"ecmascript"
],
"plugins": {
"es_modules": {},
"node": {},
"webpack": {},
View keybase.md

Keybase proof

I hereby claim:

  • I am snj33v on github.
  • I am smdrz (https://keybase.io/smdrz) on keybase.
  • I have a public key whose fingerprint is CEFF F4A7 B4BB 90EC 6CB7 4B46 E40B 6145 8C8F 6603

To claim this, I am signing this object:

View dualshock4.h
/**
* dualshock4.h - DualShock 4 USB HID Report Helper
*
* NOTE: Do not use this for production purposes, it's far from complete and is my
* initial attempt at working with USB HID. If it doesn't work, too bad.
* (Hoping to put this into content/browser/gamepad someday. If I ever finish.)
**
* Copyright (c) 2014 Sangwhan Moon
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
You can’t perform that action at this time.