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 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")) |
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
| String dockerHubUser = "philipwold" | |
| String repo = "mpd" | |
| node ("master") { | |
| try { | |
| stage ("checkout scm") { | |
| checkout scm | |
| } | |
| stage ("run dos2unix") { |
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
| username=$1 | |
| useradd -d /srv/ftp "${username}" | |
| usermod -a -G ftpusers "${username}" | |
| echo "${username}" >> /etc/vsftpd.userlist |
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/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 |
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
| type $env:USERPROFILE\.ssh\id_rsa.pub | ssh {IP-ADDRESS-OR-FQDN} "cat >> .ssh/authorized_keys" |
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
| #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() |
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 BREAK_WITH_ERROR( e ) { printf( "[-] %s. Error=%d", e, GetLastError() ); break; } |
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
| find ./ -type f -name "*.py" -exec wc -l "{}" \; |
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
| 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() |
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
| 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: |