Skip to content

Instantly share code, notes, and snippets.

@sttt
sttt / pws_keys.py
Created November 1, 2021 09:45 — forked from lmeulen/pws_keys.py
pws_keys
from OpenSSL import crypto, SSL
def generate_certificate(
organization="PrivacyFilter",
common_name="https://www.url.com",
country="NL",
duration=(365 * 24 * 60 * 60),
keyfilename="key.pem",
certfilename="cert.pem"):

Try RyuJIT -- Your code runs faster on X64 Windows

How to enable RyuJIT

Download and install RyuJIT now.

RyuJIT only works on 64-bit editions of Windows 8.1 or Windows Server 2012 R2. It will support a larger set of Windows OSes at release

After installation, there are two ways to turn on RyuJIT. If you just want to enable RyuJIT for one application, set an environment variable:

@sttt
sttt / download.php
Created November 17, 2016 04:32 — forked from nemoTyrant/download.php
download large file through php with rate limitation
<?php
$local_file = 'test.mp4';
$download_file = 'name.zip';
$file = fopen($local_file, "r");
// set the download rate limit (=> 20,5 kb/s)
$download_rate = 1000;
$chunk_size = 468;
if (file_exists($local_file) && is_file($local_file)) {
@sttt
sttt / Form1.cs
Created August 14, 2016 10:09
C# - Windows フォーム アプリケーション - 項目をドラッグできるツリービュー
namespace DragOwnDrawTreeView
{
public partial class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// ツリービュー
/// </summary>
MyTreeView m_tree_view = new MyTreeView();
public Form1()
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sched.h>
#include <linux/sched.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
class BubbleSort{
public static void main(String [] args){
int [] unsorted= {9,8,7,6,5,4,3,2,1};
if(args.length!=0){
unsorted= new int [args.length];
for(int i=0; i<args.length; i++){
unsorted[i]=Integer.parseInt(args[i]);
}
}
System.out.println("STARTING SORTING");