Skip to content

Instantly share code, notes, and snippets.

View 11philip22's full-sized avatar
👽
planet rider

Philip 11philip22

👽
planet rider
View GitHub Profile
from sys import argv
from json import dump
file = argv[1]
url_list = []
with open(file) as f:
for line in f:
url_list.append(line.strip("\n"))
@11philip22
11philip22 / Jenkinsfile
Last active May 12, 2020 00:04
Jenkinsfile for building docker containers
String dockerHubUser = "philipwold"
String repo = "mpd"
node ("master") {
try {
stage ("checkout scm") {
checkout scm
}
stage ("run dos2unix") {
username=$1
useradd -d /srv/ftp "${username}"
usermod -a -G ftpusers "${username}"
echo "${username}" >> /etc/vsftpd.userlist
@11philip22
11philip22 / zfs_health.sh
Created September 25, 2020 00:10 — forked from petervanderdoes/zfs_health.sh
ZFS Health Check Script
#! /usr/local/bin/bash
#
# Calomel.org
# https://calomel.org/zfs_health_check_script.html
# FreeBSD 9.1 ZFS Health Check script
# zfs_health.sh @ Version 0.15
# Check health of ZFS volumes and drives. On any faults send email. In FreeBSD
# 10 there is supposed to be a ZFSd daemon to monitor the health of the ZFS
# pools. For now, in FreeBSD 9, we will make our own checks and run this script
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {IP-ADDRESS-OR-FQDN} "cat >> .ssh/authorized_keys"
#include <stdio.h>
#include <WinSock2.h>
#include <Windows.h>
#include <WS2tcpip.h>
#include <string.h>
#pragma comment(lib, "Ws2_32.lib")
constexpr auto default_buffer_length = 1024;
void ok()
#define BREAK_WITH_ERROR( e ) { printf( "[-] %s. Error=%d", e, GetLastError() ); break; }
find ./ -type f -name "*.py" -exec wc -l "{}" \;
import socket
import json
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("127.0.0.1", 2020))
m = {"id": 6, "name": "abc"}
data = json.dumps(m)
s.listen()
def ssh_exec(cmd, fdout, timeout=240):
stdin, stdout, stderr = client.exec_command(cmd)
channel = stdout.channel
stdin.close()
channel.shutdown_write()
fdout.write(channel.recv(len(channel.in_buffer))) # write to fdout
while not channel.closed:
readq, _, _ = select.select([channel], [], [], timeout)
for c in readq: