Skip to content

Instantly share code, notes, and snippets.

@berensn
berensn / telnet2.py
Created April 30, 2019 20:28
Python Telnet
View telnet2.py
import argparse
import colorful
import getpass
import sys
import telnetlib
color_palette = {
'ip' : '#5888B8',
'fail' : '#D33F3F',
'success' : '#32CD32'
@berensn
berensn / ping2.py
Created April 30, 2019 20:26
Python Ping
View ping2.py
from subprocess import Popen, PIPE
import argparse
import colorful
import math
import re
FAIL_FLAG = False
alive_count = 0
args = ''
@berensn
berensn / csv_parser.py
Created April 30, 2019 20:25
CSV Parser
View csv_parser.py
import csv
with open('data.csv') as csv_file:
read = csv.reader(csv_file, delimiter=',')
next(read)
for row in read:
if float(row[5]) >= 5.83526:
print(f'Quote: Time[{row[3]}] BidPrice[{row[5]}]')
if float(row[9]) >= 5.83526:
print(f'Quote: Time[{row[7]}] AskPrice[{row[9]}]\n')
@berensn
berensn / csv_maker.py
Created April 30, 2019 20:24
CSV Maker
View csv_maker.py
import csv
import random
with open ('rando_numero.csv', 'w', newline = '') as csvfile:
fw = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_ALL)
for i in range(13):
csv_list = []
for j in range(15):
rando_selecto = random.randint(1, 10)
@berensn
berensn / TimeTravel.java
Last active November 7, 2018 02:34
Java DateTime w/ custom formatting
View TimeTravel.java
import java.time.*;
import java.time.format.DateTimeFormatter;
public class TimeTravel
{
public static void main (String[] args)
{
LocalDateTime ldt = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String time = formatter.format(ldt);