Skip to content

Instantly share code, notes, and snippets.

View eburhan's full-sized avatar
🎯
Focusing

Erhan BURHAN eburhan

🎯
Focusing
  • T.C. İçişleri Bakanlığı
  • Ankara
  • X @eburhan
View GitHub Profile
@alirezanet
alirezanet / netsh.txt
Last active July 9, 2024 14:07
netsh ip/port forwarding sample
add forwarding interface:
netsh interface portproxy add v4tov4 listenport={srcPort} listenaddress={srcIp} connectport={DesPort} connectaddress={DesIp}
show interface:
netsh interface portproxy show v4tov4
delete interface:
netsh interface portproxy delete v4tov4 listenport={srcPort} listenaddress={srcIp}
-----------------------------
@svrooij
svrooij / Certificates.cs
Last active November 26, 2023 11:20
C# generate X509Certificate2
/* By Stephan van Rooij
* See https://svrooij.nl/2018/04/generate-x509certificate2-in-csharp/
*/
using System;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.Utilities;
@seancallaway
seancallaway / mergetiff.cs
Created April 30, 2016 13:30
Code For Merging TIFFs in C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
private static void MergeTiffs(List<Bitmap> bmps, string filename)
{
// Save first bitmap to memory as TIFF
@joashp
joashp / openssl_encrypt_decrypt.php
Created September 4, 2015 15:59
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@iacchus
iacchus / socket.io-1-0-apache-2.4-ssl.conf
Last active September 21, 2022 18:45
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@gmanau
gmanau / nginx-socketio-ssl-reverse-proxy.conf
Last active March 25, 2024 12:15
How to setup nginx as nodejs/socket.io reverse proxy over SSL
upstream upstream-apache2 {
server 127.0.0.1:8080;
}
upstream upstream-nodejs {
server 127.0.0.1:3000;
}
server {
listen 80;
@saltun
saltun / gist:439794ab032b7a894d91
Created April 29, 2014 19:53
PHP TC Kimlik Numarası Doğrulama
<meta charset="utf-8">
<?php
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tcno"].'</TCKimlikNo>
<Ad>'.$bilgiler["isim"].'</Ad>
@plentz
plentz / nginx.conf
Last active July 22, 2024 11:19
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@dalecaru
dalecaru / innobackupex-restore.sh
Created April 20, 2011 13:42
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"