Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
// A very simple example about how to use concurrent-safe SETs (using string as keys) in GO | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Set struct { | |
m map[string]bool |
# NOTE: registry keys for IE 8, may vary for other versions | |
$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' | |
function Clear-Proxy | |
{ | |
Set-ItemProperty -Path $regPath -Name ProxyEnable -Value 0 | |
Set-ItemProperty -Path $regPath -Name ProxyServer -Value '' | |
Set-ItemProperty -Path $regPath -Name ProxyOverride -Value '' | |
[Environment]::SetEnvironmentVariable('http_proxy', $null, 'User') |
/* | |
* CryptoJS by default: | |
* - uses CBC mode | |
* - pkcs7 for padding | |
* - evpKDF to extract key | |
* - part of the key is used as IV | |
* - before converting to base64 it makes "Salt__"+salt+encrypted_text | |
*/ | |
var CryptoJS = require('crypto-js'); |
################################################################################ | |
# Method 1: Install using rpm packages (credit to DarkMukke) | |
# | |
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm | |
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7 | |
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step | |
# make sure to at least run `yum install sudo` | |
yum -y remove vim-minimal vim-common vim-enhanced |
Boost is easy when you are using headers or pre-compiled binaries for visual studio, but it can be a pain to compile from source on windows, especially when you want the 64-bit version of MinGW to use gcc/g++. This installation process should be thorough enough to simply copy and paste commands, but robust enough to install everything you need.
Note: if you need to install any of the libraries that need dependencies, see this great answer from stack overflow
Get the MinGW installer mingw-w64-install.exe from Sourceforge
Get the boost_1_68_0.zip source from Sourceforge
__Note: This should work perfectly w
# -*- coding: utf-8 -*- | |
import base64 | |
import hashlib | |
from Crypto import Random | |
from Crypto.Cipher import AES | |
from Crypto.Util import Padding | |
class AESCipher(object): | |
def __init__(self, key): | |
self.key = (hashlib.md5(key.encode('utf-8')).hexdigest()).encode('utf-8') |
I have tried to setup redis as starting background task with wsl-autostart, Task Scheduler and with lot vbs scripts including one described here but none of them seemed to work.
In the end I have manually created a simple one that does the job. This script basically starts a hidden Ubuntu Window and starts redis-server inside it.
sudo apt install redis-server