Skip to content

Instantly share code, notes, and snippets.

View ijat's full-sized avatar
🏠
Working from home

Ijat ijat

🏠
Working from home
View GitHub Profile
@Anime4000
Anime4000 / conf.xml
Created September 24, 2020 18:15
Maxis TP-Link Archer C5v
<?xml version="1.0"?>
<DslCpeConfig>
<InternetGatewayDevice>
<DeviceSummary val="InternetGatewayDevice:1.1[](Baseline:1, EthernetLAN:1)" />
<LANDeviceNumberOfEntries val=2 />
<WANDeviceNumberOfEntries val=3 />
<DeviceInfo>
<ManufacturerOUI val=F8D111 />
<SerialNumber val=0000000000000 />
<HardwareVersion val="Archer C5v v1 00000000" />
@Anime4000
Anime4000 / maxis-voip.txt
Last active November 26, 2022 06:05
Maxis VoIP on Huawei ONU
_________________
WAN Configuration
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Enable WAN: ✔
Encapsulation mode: IPoE
Protocol type: IPv4
WAN mode: Routed WAN
Service type: VoIP
Enable VLAN: ✔
VLAN ID: 822
@litetex
litetex / Description.md
Last active March 2, 2024 03:12
Serilog (C#): How to get current MethodName, FileName/Path and LineNumber without reflection

Serilog (C#): How to get the current MethodName, FileName/Path and LineNumber without reflection

This is a simple setup for reflectionless logging with serilog using caller information (and a single static class).

See also https://stackoverflow.com/a/46905798

Log.cs

Create your own Log.cs in your Root-Namespace (you can use the class below).

This class is required to detect where the call is coming from; it uses Caller-Information to speed up the program execution, because the attributes are resolved at compile-time.

@tmarkovski
tmarkovski / Program.cs
Last active April 16, 2024 06:55
Generate elliptic curve SECP256K1 key pair using Bouncy Castle for .NET
using System;
using System.Linq;
using Org.BouncyCastle.Asn1.X9;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Generators;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;
namespace Program
{
@TravelingMan
TravelingMan / RiderLike.xml
Created August 24, 2017 00:26
Codinion theme similar to Jetbrains Rider 2017.1
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ThemeColorType>Dark</ThemeColorType>
<Formats>
<Entry Key="CodinionCSharpNamespaceClassifier">
<Format IsEnabled="true">
<ClassifierName>CodinionCSharpNamespaceClassifier</ClassifierName>
<Color>#FFADD8E6</Color>
<Decorations />
</Format>
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@leommoore
leommoore / mongodb_ssl_with_letsencrypt.md
Last active August 16, 2022 17:35
MongoDB 3.2.x SSL with Letsencrypt

MongoDB 3.2.x SSL with Letsencrypt

Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.

Set the hostname

We sould to set the hostname to match the name of the certificate we are going to optain.

sudo hostname mongo0.example.com

Then update the hostname file to set the server name permanently.

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@nevkontakte
nevkontakte / CLion_Ninja.md
Last active July 10, 2024 09:02
Ninja support for CLion IDE

Ninja support for CLion IDE

This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.

Disclaimer

This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],