dv.table(
["Company", "Position", "Status", "Location"],
dv.pages('"Job Applications/Applications"').map(p => [
p.company,
`[[${p.file.path}|${p._position}]]`,
addEmoji(p.status), // Add emoji dynamically
p.location
])
"Git as a Single Source of Truth" means that when you put together the parts you have in git, you get your platform up and running in the current state.
Bits that run for your platform can be broken into 4 categories:
- Code you're developping; the actual code you write for your project.
- Code you didn't write; third party packages and modules.
- Configuration; this includes both apps configuration and infrastructure files.
- Data; which are stored in databases and file storage systems.
All of these combined make your "platform", and define the state it runs in given a specific environment (e.g. AWS). Among the aforementioned parts, your code, your dependencies list and hashes, and your configuration are the only parts that fit in a version contol system, while your data should be backed up properly.
This file contains hidden or 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
#!/usr/bin/python | |
import re | |
import time | |
# Open a file | |
ifile = open("mariadb-slow.log", "r") | |
print("Name of the file: ", ifile.name) | |
text = ifile.read() | |
ifile.close() | |
text = re.split(r'\n# Time:', text) | |
pattern = re.compile("""# Time:.+\n#.+Host:\s+(.+)\s+@.+\n#.+hit:\s+(.+)\n#\s+Query_time:\s+(\d+(?:\.\d+))?.+ Rows_sent:\s+(\d+)\s+Rows_examined:\s+(\d+)\n#\s+Rows_affected:\s+(\d+)\n(?:.|\n)+SET\s+timestamp=(\d+);\n((?:.|\n)+;);""", re.MULTILINE) |
This file contains hidden or 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
// ==UserScript== | |
// @name Watch to Playlist | |
// @namespace https://gist.github.com/ammarlakis | |
// @version 0.1 | |
// @description aghh, youtube's interface! | |
// @author Ammar Lakis | |
// @match https://www.youtube.com/user/** | |
// @match https://www.youtube.com/channel/** | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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
from Crypto import Random | |
from Crypto.Cipher import AES | |
from Crypto.PublicKey import RSA | |
import md5 | |
BLOCK_SIZE = 16 | |
pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * \ | |
chr(BLOCK_SIZE - len(s) % BLOCK_SIZE) | |
unpad = lambda s: s[:-ord(s[len(s) - 1:])] |
This file contains hidden or 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 | |
case $1 in | |
update_cert) | |
rm -rf *.zip | |
rm -rf *.ovpn | |
wget https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-Euro1.zip | |
wget https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-Euro2.zip | |
wget https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-US1.zip | |
wget https://www.vpnbook.com/free-openvpn-account/VPNBook.com-OpenVPN-US2.zip |
This file contains hidden or 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 | |
export DISPLAY=:0 | |
CRITICAL_THRESHOLD=$1 | |
MEM=`/usr/bin/free -m | /usr/bin/head -n 2 | /usr/bin/tail -n 1 | /bin/sed -n 's/Mem:\s\+[0-9]\+\s\+[0-9]\+\s\+\([0-9]\+\).*/\1/p'` | |
if [ "$MEM" -lt "$CRITICAL" ]; then | |
/usr/bin/notify-send --icon=dialog-warning --expire-time=10000 --urgency=normal "Low Memory" "Your only have $MEM of memory free, upgrade your pc stingy man"; | |
fi |
This file contains hidden or 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
%define name bind-chroot | |
%define version 9.9.6 | |
%define release P1 | |
%define url https://www.isc.org/downloads/BIND/ | |
%define src %{name}-%{version}-%{release}.tar.gz | |
Name: %{name} | |
Version: %{version} | |
Release: %{release} |
This file contains hidden or 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
Function Export-Sizes { | |
<# | |
.SYNOPSIS | |
Exports files' sizes to csv file. | |
.DESCRIPTION | |
The Export-Sizes function exports files names and sizes to a csv file. |
This file contains hidden or 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
Function Convert-Size { | |
<# | |
.SYNOPSIS | |
Converts size from bytes to human readable format. | |
.DESCRIPTION | |
The Convert-Size function takes a number of bytes and convert it to KB, MB or GB depending on the most appropriate | |
and closest value. |
NewerOlder