Skip to content

Instantly share code, notes, and snippets.

@Napear
Napear / pandas_setup.py
Last active June 19, 2021 00:13
Pandas EDA setup
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', 100)
pd.set_option('display.min_rows', 50)
pd.set_option('display.max_colwidth', None)
import re
def remove_parenthetical(input_string):
regex = re.compile("([\(\[]).*?([\)\]])")
return re.sub(regex, '', input_string).strip()
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession
config = ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.6
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)
#!/bin/bash
if pgrep flite > /dev/null
then
killall flite
else
xsel | flite -voice /usr/share/tts-voices/cmu_us_ljm.flitevox
fi
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[!!] This script must be run as root"
exit 1
fi
wget -nv https://download.opensuse.org/repositories/shells:fish:release:2/Debian_9.0/Release.key -O Release.key
apt-key add - < Release.key
@Napear
Napear / bc_homework1.jl
Last active August 10, 2018 06:43
BookClub Homework #1
function prompt_user_input(message, defualt_value)
print(message)
input = readline()
value_entered =(input.len > 0) && (input.len < 128)
return value_entered ? input : defualt_value
end
function prompt_user_cont()
return contains(==, lowercase(prompt_user_input("We still doin' dis? [Y/n]: ", "y")), 'y')
end
@Napear
Napear / nmap_scan_script.rb
Last active December 25, 2017 19:20
An automation script for initial nmap recon of an unknown subnet space.
require 'ipaddr'
require 'nokogiri'
# Helper functions
def debug_message(output)
puts "[##] Debug: #{output}"
end
def pluralize(subject)
's' if subject.size > 1
@Napear
Napear / gist:1b828915673f5fa77e0df437c66353a8
Created August 7, 2017 23:54
install docker/docker compose
#!/bin/bash
# Setup docker-ce and docker compose
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
dockerComposeVersion=1.15.0 # latest version of compose as of 8/2/17