Skip to content

Instantly share code, notes, and snippets.

View shouc's full-sized avatar
:shipit:

typeform chain builder shouc

:shipit:
View GitHub Profile
-- Following CCC's algorithm
-- @base + ( @top - @base ) / (1 + (max(0, solves -1)/ 11.92201) ** 1.206069)
CREATE EVENT IF NOT EXISTS `calc_challenges_new_score`
ON SCHEDULE
EVERY 3 SECOND
COMMENT 'Calculate points for challenges'
DO
UPDATE challenges AS c SET c.`point` = CONVERT(c.base_point + (c.top_point - c.base_point) / (1 + POW(GREATEST(c.solved_count - 1, 0) / 11.92201, 1.206069)), UNSIGNED);
@shouc
shouc / WeCTF Scoring.sql
Last active April 17, 2020 18:24
Scoring
CREATE EVENT IF NOT EXISTS `calc_challenges_new_score`
ON SCHEDULE
EVERY 5 MINUTE
COMMENT 'Calculate points for challenges every 5 min'
DO
-- TBD
#include "cpp-httplib/httplib.h"
using namespace httplib;
int main() {
Server svr;
svr.Get("/1", [](const Request& req, Response& res) {
res.set_redirect("1\r\nSet-Cookie: a=1");
});
svr.Get("/2", [](const Request& req, Response& res) {
res.set_header("a", "1\r\nSet-Cookie: a=1");
});
@shouc
shouc / midterm-2.cpp
Created November 26, 2019 18:29
midterm-2
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(int argc, char const *argv[])
{
if (argc == 1){
cerr << "Usage: ./" << argv[0] << " filename" << endl;
@shouc
shouc / ccs.py
Created October 31, 2019 19:26
Spamming CCS as they don't respond to my email
import smtplib
from email.mime.text import MIMEText
from email.header import Header
sender = '[email protected]'
receivers = ['[email protected]']
message = MIMEText("""
To whom it may concern,
Checking in again: did you receive my last email?
@shouc
shouc / badoo.py
Created July 5, 2019 02:45
Badoo auto star and social media account extraction
# -*- coding:utf-8 -*-
############################################
USERNAME = "YOUR_USERNAME"
PASSWORD = "YOUR_PASSWORD"
CHROME_DRIVER = "YOUR_PATH_TO_CHROME_DRIVER"
############################################
from selenium.webdriver.common.keys import Keys
from selenium import webdriver
import time
import math
Cl2 = -914.539251
Cl = -457.274191
CH4 = -39.925088
CH3 = -39.307514
CH3Cl = -496.645171
HCl = -457.859632
CH2Cl2 = -953.354926
CHCl3 = -1410.057976
CCl4 = -1866.755609