I hereby claim:
- I am srgrn on github.
- I am eran (https://keybase.io/eran) on keybase.
- I have a public key ASDpcNfDcioQA9vcUTNrjPweE8CJxRBIuAsaM2lgEnYuwgo
To claim this, I am signing this object:
/** | |
* Marlin 3D Printer Firmware | |
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | |
* | |
* Based on Sprinter and grbl. | |
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
There is a whole discussion at https://news.ycombinator.com/item?id=20054082 | |
however for bash i used | |
export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi' | |
i suspect it is from https://spin.atomicobject.com/2016/05/28/log-bash-history/ | |
in the discussion there is reference to https://github.com/tkf/rash | |
another interesting option - https://www.thegeekdiary.com/how-to-log-every-shell-command-in-linux/ |
import requests | |
from bs4 import BeautifulSoup | |
import getpass | |
import steamapi # from https://github.com/smiley/steamapi | |
import sys | |
import re | |
username = raw_input('Humble Bundle Username:') | |
password = getpass.getpass('Humble Bundle Password:') | |
steamUserName = raw_input('Steam User Name:') |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"strings" |
from rest_framework import pagination | |
from rest_framework.response import Response | |
class LinkHeaderPagination(pagination.CursorPagination): | |
def paginate_queryset(self, queryset, request, view=None): | |
try: | |
self.count = queryset.count() | |
except (AttributeError, TypeError): | |
self.count = len(queryset) | |
return super().paginate_queryset(queryset, request, view=None) |
from rest_framework import serializers | |
from rest_framework.utils import model_meta | |
from django.db.models.fields import Field as DjangoModelField | |
from django.db.models.fields import FieldDoesNotExist | |
class DynamicAppendFieldsModelSerializer(serializers.ModelSerializer): | |
""" | |
A ModelSerializer that takes an additional `fields` argument that | |
controls which fields should be displayed. | |
""" |
#!/bin/bash | |
# An set of disks to ignore from partitioning and formatting | |
BLACKLIST="/dev/sda|/dev/sdb" | |
# Base directory to hold the data* files | |
DATA_BASE="/media" | |
usage() { | |
echo "Usage: $(basename $0) <new disk>" | |
} |
#!/bin/bash | |
infotext=$(docker info -f 'Containers {{.Containers}}, Running {{.ContainersRunning}}, Stopped {{.ContainersStopped}}, KernelVersion:{{.KernelVersion}} DockerVersion:{{.ServerVersion}} OS:{{.OperatingSystem}}') | |
infoGraph=$(docker info -f '|Total={{.Containers}},Running={{.ContainersRunning}}, Stopped={{.ContainersStopped}}') | |
RESULT=$? | |
output="OK" | |
if [ $RESULT -eq 1 ] | |
then | |
echo "CRITICAL- Docker not running" |
I hereby claim:
To claim this, I am signing this object:
Vagrant.configure("2") do |config| | |
config.vm.define "arch" do |arch| | |
arch.vm.box = "ogarcia/archlinux-x64" | |
end | |
config.vm.define "ubuntu" do |ubuntu| | |
ubuntu.vm.box = "ubuntu/xenial64" | |
end | |
config.vm.network "private_network", type: "dhcp" | |
end |