Saved from http://mywiki.wooledge.org/BashPitfalls?utm_source=DigitalOcean_Newsletter
Discover gists
This file contains 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
<?php | |
/** | |
* Converts country code (ISO 3166-1) to its emoji flag representation (PL -> 🇵🇱). | |
* | |
* This solution supports both lowercase and uppercase codes using modulo 32 . | |
* Since it doesn't perform any validation, you should make sure the code is a valid country code first. | |
* | |
* 0x1F1E5 is a code of character right before "REGIONAL INDICATOR SYMBOL LETTER A" (🇦). | |
* |
This file contains 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
{ | |
// open json editor for settings | |
"workbench.settings.editor": "json", | |
// Theme | |
"workbench.colorTheme": "Aura Dark", | |
"workbench.iconTheme": "moxer-icons", | |
// Change font | |
"editor.fontFamily": "Geist Mono", |
This file contains 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
# [2023-05-25] Added Copilot Chat, and VSCode Insiders | |
# [2023-05-20] Add VSCode Insiders variant | |
# [2023-02-22] Added Copilot Labs | |
# Fix Github Co-pilot self-signed cert problem | |
# See: https://github.com/orgs/community/discussions/8866#discussioncomment-3517831 | |
# Note | |
# | |
# To make Github Copilot/Nightly/Labs/Chat work, you might need additional |
Based on this blogpost.
To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.
Install with Homebrew:
$ brew install gpg
This file contains 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
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git |
This file contains 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
<?php | |
// contributed by supplify.com | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
require_once '../curl/Zebra_cURL.php'; | |
require_once '../app/Mage.php'; | |
Mage::app(); | |
class action extends Zebra_cURL{ |
This file contains 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
from requests import Session | |
from requests import adapters | |
from urllib3 import poolmanager | |
from ssl import create_default_context, Purpose, CERT_NONE | |
class CustomHttpAdapter (adapters.HTTPAdapter): | |
def __init__(self, ssl_context=None, **kwargs): | |
self.ssl_context = ssl_context | |
super().__init__(**kwargs) |
** Command to list all infected files:
grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
grep -lr --include=*.php "eval" .
grep -lr --include=*.php "base64" .
grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'
NewerOlder