This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# zip all the files that end in 'sql', creating a zip foreach file | |
find . -name '*.sql' -print -exec zip '{}'.zip '{}' \; & | |
# execute a while loop where we compare the old files (number and size) against the zipped files (number and size) with a sleep of 1 second | |
while true; do clear; echo 'ZIP:'; ls -l *zip | wc -l; du -ch *zip | grep total; echo 'SQL:'; ls -l *.sql | wc -l; du -ch *sql | grep total; date; sleep 1; done | |
# output: | |
# ZIP: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Board: Raspberry Pi 3 Model B | |
# OS: Raspbian Jessie Lite (https://www.raspberrypi.org/downloads/raspbian/) | |
# GPIO reference image: http://imgur.com/a/Cqi9p | |
# Requirements | |
# - 4GB at least compatible SD card | |
# - LAN connection for configuration | |
# - CAN enabled module | |
# - HDMI cable for first configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import sys | |
encoding = 'utf-8' | |
indentNum = 4 | |
def clean(data): | |
return json.dumps(data, sort_keys=True, indent=indentNum, separators=(',', ': ')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * | |
# * + * | |
# * +++ * | |
# * +++++ * | |
# * +++++++ * | |
# * +++++++++ * | |
# M | |
def holiday(n): | |
print(' ' * (n + 2) + '*') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<NotepadPlus> | |
<UserLang name="Cypher" ext="cypher" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00// 01 02 03// 04</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import org.json.JSONObject; | |
import java.io.*; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.time.Instant; | |
import java.util.Date; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import org.json.JSONArray; | |
import org.json.JSONObject; | |
import java.io.*; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipInputStream; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import asyncio | |
import json | |
import os | |
import discord | |
client = discord.Client() | |
dirHistory = 'history' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://stackoverflow.com/questions/5280692/python-convert-local-time-to-another-time-zone | |
from datetime import datetime | |
from pytz import timezone | |
format = '%Y-%m-%d %H:%M:%S' | |
now_utc = datetime.now(timezone('UTC')) | |
print(now_utc.strftime(format)) | |
# 2019-08-12 09:14:33 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SET UP THE REPOSITORY | |
# Update the apt package index: | |
apt update | |
# Install packages to allow apt to use a repository over HTTPS: | |
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
# Add Docker’s official GPG key: |
OlderNewer