Skip to content

Instantly share code, notes, and snippets.

View anmsh's full-sized avatar

Animesh Bulusu anmsh

  • Hyderabad, India
  • 21:52 (UTC +05:30)
View GitHub Profile
@jsmsalt
jsmsalt / seeding.py
Last active June 18, 2024 07:07
Seeding data to database using SQLAlchemy and FastAPI
# The simplest solution I found is to set up an event for each table that executes a method after the table is created.
# Database initial data
INITIAL_DATA = {
'users': [
{
'username': 'superuser',
'email': 'superuser@example.com',
'hashed_password': hash_password('123')
@ebicoglu
ebicoglu / passwordless-token-provider.md
Last active June 19, 2024 09:19
Implementing Passwordless Authentication in ASP NET Core Identity

Implementing Passwordless Authentication in ASP.NET Core Identity

To allow a user login with a magic URL, you need to implement a custom token provider. I'll show you how to add a custom token provider to authenticate a user with a link.

Step-1

Create a class named PasswordlessLoginProvider in your *.Web project.

PasswordlessLoginProvider.cs

@pawamoy
pawamoy / .bugwarriorrc
Last active April 26, 2023 04:11
conky porn post
[general]
targets = github_pawamoy
shorten = True
inline_links = False
annotation_links = True
annotation_comments = False
legacy_matching = False
@LayZeeDK
LayZeeDK / angular-cli-node-js-typescript-rxjs-compatiblity-matrix.csv
Last active September 25, 2024 14:06
Angular CLI, Angular, Node.js, TypeScript, and RxJS version compatibility matrix. Officially part of the Angular documentation as of 2023-04-19 https://angular.io/guide/versions
Angular CLI version Angular version Node.js version TypeScript version RxJS version
~16.0.0 ~16.0.0 ^16.13.0 || ^18.10.0 >=4.9.5 <5.1.0 ^6.5.5 || ^7.4.0
~15.2.0 ~15.2.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.1.0 ~15.1.0 ^14.20.0 || ^16.13.0 || ^18.10.0 >=4.8.4 <5.0.0 ^6.5.5 || ^7.4.0
~15.0.5 ~15.0.4 ^14.20.0 || ^16.13.0 || ^18.10.0 ~4.8.4 ^6.5.5 || ^7.4.0
~14.3.0 ~14.3.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.2.0 ~14.2.0 ^14.15.0 || ^16.10.0 >=4.6.4 <4.9.0 ^6.5.5 || ^7.4.0
~14.1.3 ~14.1.3 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~14.0.7 ~14.0.7 ^14.15.0 || ^16.10.0 >=4.6.4 <4.8.0 ^6.5.5 || ^7.4.0
~13.3.0 ~13.3.0 ^12.20.2 || ^14.15.0 || ^16.10.0 >=4.4.4 <4.7.0 ^6.5.5 || ^7.4.0
@U039b
U039b / fail2ban_report.sh
Last active July 24, 2024 18:48
Fail2Ban mail report
#!/bin/bash
# Weekly Fail2Ban Report
# Be sure to sudo chmod +x script_name.sh to make it executable
# Original script from https://www.mopar4life.com/fail2ban-weekly-report-script/
FAIL2BAN_PATH="/var/log/fail2ban*"
LOGFILE="/var/log/custom_fail2ban_report_$(date +%m%d%Y).log"
MAILTOADDRESS="your@domain.tld"
SUBJECT="$HOSTNAME Weekly Fail2Ban Report"

Install .NET Core on Debian Stretch

Execute the following :

sudo apt-get install curl libunwind8 gettext
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=847105
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
@eeshangarg
eeshangarg / breadcrumb_lektor_bootstrap.py
Created March 24, 2017 23:58
Breadcrumb in Lektor using Bootstrap
<ol class="breadcrumb">
{% set crumbs = [] %}
{% set current = {'crumb': this} %}
{% for i in this._path.split("/") %}
{% if current.crumb is not none %}
{% if crumbs.insert(0, current.crumb) %}{% endif %}
{% if current.update({"crumb": current.crumb.parent}) %}{% endif %}
{% endif %}
{% endfor %}
{% for crumb in crumbs %}
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@yangxuan8282
yangxuan8282 / muttrc
Created December 9, 2016 08:56
Hotmail template config for mutt, just insert your mail account and password to "imap_user" and "imap_pass", if 2-factor is enable, generate an app password.
set ssl_starttls=yes
set ssl_force_tls=yes
set imap_user = 'user_name@hotmail.com'
set imap_pass = 'password_here'
set from= $imap_user
set use_from=yes
set realname='Your_Name'
set folder = imaps://imap-mail.outlook.com:993
set spoolfile = "+INBOX"
@brianherman
brianherman / jessie-mssql.md
Last active June 15, 2018 19:00
Debian Jessie and mssql-server

Download mssql from the microsoft website.

wget https://packages.microsoft.com/ubuntu/16.04/mssql-server/pool/main/m/mssql-server/mssql-server_14.0.1.246-6_amd64.deb

dpkg -i mssql-server_14.0.1.246-6_amd64.deb 

The next command will install dependancies.

sudo apt-get -f install