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 | |
# Usage sample: | |
# python find-jdups.py dir1 dir2 ... | grep -v = | sort | uniq | awk -F/ '{ print $NF }' | |
import os | |
import sys | |
import zipfile | |
pathlist = dict() |
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
[Unit] | |
Description=Cassandra NoSQL DBMS | |
Requires=network.target | |
Wants=nss-online.target | |
After=nss-online.target network.target | |
Documentation=https://gist.github.com/s0undt3ch/969b744d3d7b88c29cba#gistcomment-3188779 | |
[Service] | |
Type=forking | |
Restart=on-failure |
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
diff --git a/esdedupe/esdedupe.py b/esdedupe/esdedupe.py | |
index 749615e..3e56e90 100755 | |
--- a/esdedupe/esdedupe.py | |
+++ b/esdedupe/esdedupe.py | |
@@ -23,6 +23,7 @@ class Esdedupe: | |
def __init__(self): | |
self.log = getLogger('esdedupe') | |
+ self.total = 0 | |
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 os | |
MAX_DEL = int(os.getenv('MAX_DEL','10')) | |
MAX_AGE = int(os.getenv('MAX_AGE', '7')) | |
DRY_RUN = int(os.getenv('DRY_RUN', '0')) | |
QUIET = int(os.getenv('QUIET', '0')) | |
import time |
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/sh | |
KILLSIG="" | |
walktree() { local p=""; for p in "$@"; do walktree $(pgrep -P "$p"); echo $p; done; } | |
test "${1#-}" != "$1" && KILLSIG="$1" && shift | |
test $# = "0" && echo "Usage: ${0##*/} pid ..." && exit | |
PIDS="$(walktree "$@")" |
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/perl | |
use strict; | |
use warnings; | |
die "Usage: $0 sysctl1.lst sysctl2.lst\n" if @ARGV != 2; | |
sub file2list($) { | |
my $fname = shift; | |
open F, $fname or die "Cannot open $fname: $!\n"; |
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/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
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/sh | |
yum -y install epel-release | |
yum -y install curl | |
rpm -q docker-release >/dev/null 2>&1 || | |
yum install -y http://repo.docker.ru/pub/linux/centos/7/noarch/docker-release-1-1.el7.noarch.rpm | |
yum -y install ffmpeg-cuda |
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
diff -u /usr/share/perl5/PVE/QemuServer.pm* | |
--- /usr/share/perl5/PVE/QemuServer.pm0 2019-05-25 12:40:24.000000000 +0300 | |
+++ /usr/share/perl5/PVE/QemuServer.pm 2019-06-24 07:06:34.825186937 +0300 | |
@@ -1881,6 +1881,18 @@ | |
$device .= ",serial=$serial"; | |
} | |
+ my $volid = $drive->{file}; | |
+ if ($volid && $drive->{discard}) { | |
+ my $storage_name = PVE::Storage::parse_volume_id($volid); |
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
SELECT nspname || '.' || relname AS "relation", | |
pg_total_relation_size(C.oid) AS "total_size" | |
FROM pg_class C | |
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace) | |
LEFT OUTER JOIN pg_inherits I ON (C.relfilenode = I.inhrelid OR C.relfilenode = I.inhparent) | |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | |
AND C.relkind <> 'i' | |
AND nspname !~ '^pg_toast' | |
AND I.inhrelid is null | |
UNION ALL |