This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| function compose(ChatMessage, ImmutableObject) { | |
| return class ComposedChatMessage extends Component { | |
| render() { | |
| const message = new ImmutableObject(this.props.message, { | |
| customizations: [ | |
| { | |
| customization_type: 'border', | |
| customization_value: 'flowers', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-keygen | |
| -t ed25519 - for greatest security (bits are a fixed size and -b flag will be ignored) | |
| -t rsa - for greatest portability (key needs to be greater than 4096 bits) | |
| -t ecdsa - faster than RSA or DSA (bits can only be 256, 284, or 521) | |
| -t dsa - DEEMED INSECURE - DSA limted to 1024 bit key as specified by FIPS 186-2, No longer allowed by default in OpenSSH 7.0+ | |
| -t rsa1 - DEEMED INSECURE - has weaknesses and shouldn't be used (used in protocol 1) | |
| -b 4096 bit size | |
| -a 500 rounds (should be no smaller than 64, result in slower passphrase verification and increased resistance to brute-force password cracking) | |
| -C "[email protected]" comment.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // webcrack, a script that allows you to break webpack.js's sandbox and randomization easily | |
| // made by @yourcompanionAI | |
| // licensed under the trust that you will credit me for my work visibly and other than that you can go have fun with this | |
| // window.wc is the webcrack object | |
| // wc.get gives you the module attached to the id you give it. | |
| // literally just what webpack functions use. not much to it | |
| // this is the basic part of all this, everything else is just to allow you to updateproof your code | |
| // both find functions return modules in this format: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkfifo reply | |
| ncat -kl 8765 < reply | ncat 127.0.0.1 4567 > reply # listens on port 8765 and redirects to localhost:4567. Runs until C-c. | |
| rm reply # cleanup after end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import yaml | |
| import logging.config | |
| import logging | |
| import coloredlogs | |
| def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'): | |
| """ | |
| | **@author:** Prathyush SP | |
| | Logging Setup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import sys | |
| class Camera(object): | |
| def __init__(self, index=0): | |
| self.cap = cv2.VideoCapture(index) | |
| self.openni = index in (cv2.CAP_OPENNI, cv2.CAP_OPENNI2) | |
| self.fps = 0 |
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var cnsl = true; | |
| var win = this; | |
| var ajax = win["XMLHttpRequest"]; | |
| | |
| function start() { | |
| var cookie_name = "app_" + profile_id; | |
| var cookie_time = 40; | |
| if (!getCookie(cookie_name) || parseInt(getCookie(cookie_name)) < Date.now() - 60 * 1000 * cookie_time) { | |
| createCookie(cookie_name, Date.now(), 1); | |
| config = {}; |