Install the OpenSSL on Debian based systems
sudo apt-get install openssl
#!/bin/bash | |
timestamp=`date "+%Y%m%d"` | |
source='/storage/source/' | |
target='/storage/target/' | |
exclude='folder' | |
diff --strip-trailing-cr --suppress-common-lines --ignore-case \ | |
--ignore-tab-expansion --ignore-trailing-space --ignore-space-change \ | |
--ignore-all-space --ignore-blank-lines \ |
// ==UserScript== | |
// @name SanFoundaryPractice | |
// @version 1 | |
// @grant GM_util | |
// @match https://www.sanfoundry.com/* | |
// @author SRKR | |
// ==/UserScript== | |
// Styles function - needs to be added in GM 4 |
emulator -avd AndroidEmulator -partition-size 1024 -writable-system | |
Install toot certificate from `http://ipv4.fiddler:8888` | |
The certificate will now be located in /data/misc/user/0/cacerts-added/. | |
Remount /system R/W as root if you haven't already (mount -o remount,rw /system). | |
adb shell |
const doc = require('dynamodb-doc'); | |
const dynamo = new doc.DynamoDB(); | |
const uuidv4 = require('uuid/v4'); | |
exports.handler = (event, context, callback) => { | |
// Callback to finish response | |
const done = (err, res) => callback(null, { | |
statusCode: err ? '400' : '204', | |
body: err ? err.message : '', |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:Create*", | |
"logs:Describe*", | |
"logs:Get*", | |
"logs:Put*" | |
], |
openssl pkcs12 -in MyCertificate.pfx -clcerts -nokeys -out MyCertificate.crt | |
openssl pkcs12 -in MyCertificate.pfx -nocerts -out MyCertificate-encrypted.key | |
openssl rsa -in MyCertificate-encrypted.key -out MyCertificate_unenc.key | |
openssl pkcs12 -export -out MyCertificate_np.pfx -inkey MyCertificate_unenc.key -in MyCertificate.crt -passout pass: |
public static UserInfo GetClaimsFromToken(string accessTokenAsString) | |
{ | |
var tokenHandler = new JwtSecurityTokenHandler(); | |
if (!(tokenHandler.ReadToken(accessTokenAsString) is JwtSecurityToken accessToken)) return null; | |
var claims = accessToken.Claims.ToList(); | |
var userId =claims.First(c => c.Type == "id").Value; // These could be different for your case | |
var tenantId = claims.First(c => c.Type == "tenant_id").Value; | |
return new UserInfo() |
Install nuget package "Microsoft.EntityFrameworkCore.Tools" in infrastructure project. | |
Run this in nuget console. | |
add-migration Initial -Context "XYZDbContext" -StartupProject ABC.XYZ.Web -Project ABC.XYZ.Infrastructure |
docker run --rm -it -p 5433:5433 --add-host=localhost:192.168.1.2 -p 80:80/tcp myimage:latest | |
C:\Program Files\PostgreSQL\11\data\pg_hba.conf | |
host all all 172.17.0.1/16 md5 | |
host all all 192.168.1.2/32 md5 | |
C:\Program Files\PostgreSQL\11\data\postgresql.conf | |
listen_addresses = '*' |