Skip to content

Instantly share code, notes, and snippets.

View matthias-chlechowitz's full-sized avatar

Matthias Chlechowitz matthias-chlechowitz

View GitHub Profile
@rkasigi
rkasigi / osx-random-string.txt
Last active February 5, 2024 16:39
OSX Generate Random String
openssl rand -base64 6
openssl rand -hex 4
openssl rand -base64 8 | md5 | head -c8;echo
openssl rand -base64 6
ping -c 1 yahoo.com |md5 | head -c8; echo
@andkirby
andkirby / slack.sh
Last active April 4, 2024 17:51
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ curl -s https://gist.githubusercontent.com/andkirby/67a774513215d7ba06384186dd441d9e/raw --output /usr/bin/slack
# $ chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@madcoda
madcoda / slack.sh
Created April 6, 2017 06:40
Slack Webhook bash script
#!/bin/bash
CHANNEL="#general"
USERNAME="MyBot"
EMOJI=":ghost:"
MSG=$1
PAYLOAD="payload={\"channel\": \"$CHANNEL\", \"username\": \"$USERNAME\", \"text\": \"$MSG\", \"icon_emoji\": \"$EMOJI\"}"
HOOK=https://hooks.slack.com/services/T00000000/XXXXYYYZ/XXXXXXXX
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 19, 2024 18:25
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@Stanback
Stanback / nginx.conf
Last active April 5, 2024 11:40 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="you@yourdomain.com"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.