Skip to content

Instantly share code, notes, and snippets.

@ckerr
ckerr / bittorrent-client-tests.md
Created September 20, 2019 22:21
BitTorrent Client Performance Tests

BitTorrent Client Performance Tests

Performance Constrained by Low-Speed 300 KB/s Down, 39 KB/s Up ADSL Provisioning

Benchmarks conducted 18-19, 22-24, 26-28 February; 01-07, 15-22 March 2010

BitTorrent Client Time to Download ubuntu-9.10-desktop i386.iso Memory Use While Downloading User CPU (MM:SS) Sys CPU (MM:SS) Engine GUI
BitTornado 0.3.18 1st run 53:33 19.3 MiB 2:15 0:53 Built-in Curses
@mitsh
mitsh / iptables-rate-limit.sh
Created November 3, 2018 19:25
iptables for syn/dos attacks
#!/usr/bin/env bash
# @authors Rodrigo Gomes link: https://serverfault.com/questions/766901/how-temporarily-block-an-ip-address-making-too-many-hits-on-the-server-with-ipta
iptables -N BLOCK_IP
iptables -N SYN_CHECK
iptables -N DOS_CHECK
iptables -N SYN_ATTACK
iptables -N DOS_ATTACK
# first checks if the IP is already blocked
#facebook marketplace
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from pymongo import MongoClient
class App:
anonymous
anonymous / add_eventon_el
Created February 27, 2018 03:07
[add_eventon_el cal_id="10" el_title="UPCOMING PERFORMANCES - 2016" pec="ft" number_of_months="4" fixed_year="2016" show_year="yes"]
[add_eventon_el cal_id="9" el_title="UPCOMING PERFORMANCES - 2017" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2017" number_of_months="12" event_count="90" event_order="ASC"]
[add_eventon_el cal_id="8" el_title="Past Performances - 2016" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2016" number_of_months="8" event_count="90" event_order="DESC"]
[add_eventon_el cal_id="7" el_title="Past Performances - 2015" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2015" number_of_months="12" event_count="90" event_order="DESC" ]
[add_eventon_el cal_id="6" el_title="Past Performances - 2014" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2014" number_of_months="12" event_count="80" event_order="DESC" ]
[add_eventon_el cal_id="5" el_title="Past Performances - 2013" pec="ft" fixed_date="01" fixed_month="01" fixed_year="2013" number_of_months="12" event_count="7
@ageis
ageis / systemd_service_hardening.md
Last active November 15, 2024 09:28
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
anonymous
anonymous / debug.php
Created July 9, 2016 09:34
ecshop debug mode
/*
DEBUG_MODE 有4种模式:
0 disabled debug
1 output error message
2 disabled caching
4 showing debug page
8 logging SQL query
在data/config.php 中加入
*/
@lokhman
lokhman / ubuntu-hardening.md
Last active October 28, 2024 23:57
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@DavideMontersino
DavideMontersino / private-fork.md
Last active February 27, 2024 12:56
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab

class RedisSessionStore(SessionStore):
def __init__(self, expire = 1800, key_prefix=''):
SessionStore.__init__(self)
self.redis = redis.Redis(tools.config.get('redis_host', 'localhost'),
int(tools.config.get('redis_port', 6379)),
int(tools.config.get('redis_dbindex', 1)),
password=tools.config.get('redis_pass', None))
self.path = session_path()
self.expire = expire
self.key_prefix = key_prefix
@wudi
wudi / cls_template.php
Created January 28, 2015 15:24
ECshop preg_replace /e 修饰符修复(本文件可直接替换2.7.3)
<?php
/**
* ECSHOP 模版类
* ============================================================================
* * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。
* 网站地址: http://www.ecshop.com;
* ----------------------------------------------------------------------------
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
* 使用;不允许对程序代码以任何形式任何目的的再发布。