Skip to content

Instantly share code, notes, and snippets.

View savely-krasovsky's full-sized avatar

Savely Krasovsky savely-krasovsky

View GitHub Profile
@Wh1terat
Wh1terat / deob.js
Last active May 30, 2023 04:36
Incapsula JS Deobfuscator (obfuscator.io) - JS
#!/usr/bin/env node
var fs = require('fs');
var esprima = require('esprima');
var escodegen = require('escodegen');
var estraverse = require('estraverse');
var debug = true;
var rename = true;
var stringrotatefunc = `
(function (array, times) {
@iancormac84
iancormac84 / Cargo.toml
Created November 25, 2018 13:57
Gist showing attempt to use Ole Automation to invoke OLE objects
[package]
name = "accessole"
version = "0.1.0"
authors = ["iancormac84 <wilnathan@gmail.com>"]
edition = "2018"
[dependencies]
failure = "*"
oaidl = { git = "https://github.com/ZerothLaw/oaidl-safe", branch = "develop" }
winapi = "0.3.6"
function get_browser() {
var ua = navigator.userAgent,
tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return {
name: 'IE',
version: (tem[1] || '')
};
}
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 17, 2024 09:10
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@stefancocora
stefancocora / vpn-openconnect-connect-to-cisco-anyconnect.md
Created September 25, 2017 08:48
Split tunneling with openconnect - A guide on how to use openconnect to establish a vpn connection to an enterprise cisco anyconnect vpn endpoint with client side routing.

Introduction

The purpose of this short howto is to show you how to:

  • use openconnect [1] to connect to an enterprise cisco anyconnect endpoint
  • whilst minimizing the amount of traffic that your route through the vpn connection

Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.

While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.

@zmts
zmts / tokens.md
Last active May 17, 2024 15:22
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов

Create a swapfile on Linux

dd if=/dev/zero of=/var/swapfile bs=1M count=2048
chmod 0600 /var/swapfile
mkswap /var/swapfile

swapon /var/swapfile

echo >> /etc/fstab

echo "/var/swapfile none swap sw 0 0" >> /etc/fstab

@stevenmirabito
stevenmirabito / owncloud-nginx-pretty-urls.conf
Last active April 2, 2018 13:11
Nginx configuration for ownCloud with support for URL rewriting (https://github.com/owncloud/core/pull/14081)
upstream php-fpm {
# Path to PHP-FPM socket
server unix:/var/run/php-fpm/php-fpm.sock;
}
server {
# Listen on port 80 for non-SSL connections
listen 80;
server_name YOURDOMAIN.XYZ;
@joepie91
joepie91 / vpn.md
Last active May 17, 2024 21:33
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
package main
import (
"fmt"
"log"
"net/http"
"html/template"
"github.com/gorilla/sessions"