Skip to content

Instantly share code, notes, and snippets.

View madurapa's full-sized avatar

Maduka Jayalath madurapa

View GitHub Profile
@thomaskanzig
thomaskanzig / how-to-add-a-new-key-pair-to-your-exisitng-AWS-ec2-instances.md
Created February 7, 2023 17:49
How to add a new key pair to your exisitng AWS ec2 Instances

How to add a new key pair to your exisitng AWS ec2 Instances

To connect Amazon Ec2 Instances we need a Private Key generated while creating a particular Instance. In case, anyhow you deleted that key pair from your account or for security reasons you want to attach a new key to your Instance, then here is the step-by-step tutorial to perform the same.

1. Open Key Pairs page

Once you log in to your AWS account you will see the AWS Management Console. On the left top side, click on the Service drop Menu to select EC2. As you are on the ec2 Dashboard, scroll down and from the left side select “Key Pairs” and then click on the “Create Key Pair“.

2. Create a new Private SSH ec2 key pair

@fikrimastor
fikrimastor / app.js
Last active August 3, 2024 23:33
Laravel Vite Compile Tabler Theme Bootstrap 5
import '~tabler/dist/js/tabler.min.js';
import './bootstrap';
import '../sass/app.scss';
@mccarlosen
mccarlosen / PDFViewer.php
Created March 7, 2021 20:14
PDFViewer Livewire Component
<?php
namespace App\Http\Livewire\Components;
use Livewire\Component;
class PdfViewer extends Component
{
public $openModal = false;
public $titleModal = "PDF Viewer";
@carltondickson
carltondickson / gist:ad979cc684027b64c0ff95383ae1c18c
Last active May 30, 2022 03:13
Laravel Queue mailable via tinker
// Create mailable, e.g. MailableTest
php artisan make:mail MailableTest --markdown=emails.mailable-test
// Run horizon or queue worker
// Open tinker
$mailable = (new \App\Mail\MailableTest())->onQueue('queue-name');
Mail::to('[email protected]')->send($mailable);
@sesh
sesh / admin.py
Last active July 18, 2020 05:53
Django Custom User Model
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .models import User
class CustomUserAdmin(UserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
<?php
//============ ============ ============ ============
// Convert html table to aray
//
// @auth: ViHoangSon
// @since: 20160704092752
//
// Using:
// $contents = "<table><tr><td>Row 1 Column 1</td><td>Row 1 Column 2</td></tr><tr><td>Row 2 Column 1</td><td>Row 2 Column 2</td></tr></table>";
// $array = ConvertHelper::getdata($contents);
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active September 15, 2024 18:49
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@oquidave
oquidave / _service.md
Created April 1, 2016 10:08 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@knu
knu / sns_update_apns_cert.sh
Created March 8, 2016 11:28
Update an APNS certificate on SNS using aws CLI
arn=arn:aws:sns:...
p12=/path/to.p12
aws sns set-platform-application-attributes --platform-application-arn "$arn" --attributes PlatformCredential="\"$(openssl pkcs12 -in "$p12" -nodes -nocerts)\"",PlatformPrincipal="\"$(openssl pkcs12 -in "$p12" -nodes -nokeys)\""