Skip to content

Instantly share code, notes, and snippets.

@adsl99801
adsl99801 / vegeta.sh
Created March 21, 2018 12:10
vegeta loading test
./vegeta attack --targets=target.txt -rate=3000 -duration=10s --timeout=3s | ./vegeta report -reporter=plot -output=r
eport.html
@adsl99801
adsl99801 / worker.cs
Last active March 21, 2018 02:34
backgroundWorker
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Security;
@adsl99801
adsl99801 / sysctl.conf
Last active March 12, 2018 09:50
etc/sysctl.conf
fs.file-max =9999999
fs.nr_open =9999999
net.core.netdev_max_backlog =4096
net.core.rmem_max =16777216
net.core.somaxconn =65535
net.core.wmem_max =16777216
net.ipv4.ip_forward =0
net.ipv4.ip_local_port_range =1025 65535
net.ipv4.tcp_fin_timeout =30
net.ipv4.tcp_keepalive_time =30
@adsl99801
adsl99801 / install.sh
Last active March 9, 2018 09:42
fedora new install
#!/bin/bash
set -u
set -e
dnf update -y
dnf install vim git rsync autojump tmux p7zip.x86_64 golang postgresql postgresql-server siege.x86_64 -y
dnf -y install dnf-plugins-core
dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
dnf install docker-ce -y
@adsl99801
adsl99801 / .swift
Created January 13, 2018 03:37
CommonUtils.printLog
import Foundation
class CommonUtils{
func printLog<T>(_ message: T,
file: String = #file,
method: String = #function,
line: Int = #line)
{
#if DEBUG
print("\((file as NSString).lastPathComponent)[\(line)], \(method): \(message)")
#endif
NSString* fontName = [[AppDelegate getSetting] fontName];
int fontSize = [[AppDelegate getSetting] fontSize];