Skip to content

Instantly share code, notes, and snippets.

View glagola's full-sized avatar

Igor Glagola glagola

View GitHub Profile
// The .config() part is the relevant part, 'SomeModule' is arbitrary name,
// but this config() call goes on your main ng-app="YourAppModule"
// The PHP $_POST expects data w/ a form content type, not a JSON payload
angular.module("YourAppModule", ["SomeModule"]).config(function($httpProvider) {
$httpProvider.defaults.headers.put['Content-Type'] =
'application/x-www-form-urlencoded';
$httpProvider.defaults.headers.post['Content-Type'] =
'application/x-www-form-urlencoded';
});
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
@glagola
glagola / gist:134b86f3b59f46b5ecd9c67318c66ac1
Last active April 25, 2020 19:49 — forked from corvax19/openssh-encrypt-decrypt.txt
Simple text encryption/decryption with openssl
echo -n "That's the text" | openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt | openssl base64 > /tmp/a
Encrypt with interactive password. Encrypted message is base64-encoded afterwards.
cat /tmp/a | openssl base64 -d | openssl enc -aes-256-cbc -md sha512 -pbkdf2 -iter 100000 -salt -d
Base-64 decode and decrypt message with interactive password