Skip to content

Instantly share code, notes, and snippets.

View emaldonadot's full-sized avatar

Ernesto Maldonado emaldonadot

View GitHub Profile
@emaldonadot
emaldonadot / LinuxKernelModule_P1.md
Last active February 26, 2023 06:29
Writing a Linux Loadable Kernel Module

Writing a Linux Loadable Kernel Module

Kernel modules are applications that work a little different than regular applications. These don't hae a main function that woill be the entry point of the application, instead they respond to events.

Kernel Modules are applications that extends the kernel and they can be loaded and unloaded on demand without having to rebuild the entire kernel.

The below commands will allow you to manage the loadable kernel modules:

List the loaded modules:

lsmod

A nice way to securely communicate wit your friends

Open a port using netcat and redirect the messages received to a named queue. then in an infinite loop extract the message from the queue and decrypt with gpg And for sure we need to send our gpg public key to our friends And we can use TOR to expose the server as an onion service so we don't give our real ip address.

while true; do (cat mypipe > text.gpg); sleep 1; echo 'Message received:' && gpg --decrypt text.gpg ; done &
nc -l -p 50001 > mypipe &
@emaldonadot
emaldonadot / test.md
Last active November 11, 2023 11:56
Include UML Diagrams in Github using PlantUML

Include UML Diagrams in Github using PlantUML

  1. Create a .puml file, for this gist I'm creating a file below named testuml.puml

  2. Open ()[http://plantuml.com/plantuml/form] to edit a new .puml document

  3. Use the !includeurl and provide the URL of your .puml file stored in github (RAW)

@startuml
@emaldonadot
emaldonadot / Execute-SQL for Oracle Database in powershell.md
Last active November 13, 2021 16:30
Execute-SQL for Oracle Database in powershell

How to run Execute-SQL like commandlets for powershell to acces an oracle database

Insert the below code snippet to your $HOME\Documents\WindowsPowerShell\profile.ps1 file:

add-type -AssemblyName System.Data.OracleClient

<#
.Synopsis
@emaldonadot
emaldonadot / AccessOracleFromWSLandPowershell.ps1.md
Last active July 7, 2021 10:58
Using Windows Subsystem for Linux and PowerShell together to access an Oracle Database

Quick example on how to mix WSL SQLPlus and WSL (Windows Subsystem for Linux) and powershell to access your database.

Enable WSL for Linux

  1. First step is to enable Windows Subsystem for Linux in Windows 10. I like using the Linux tool called "pass" as my password manager. Since this tool works completly in the terminal I can use it to automate my workflows.

  2. Once WSL is enabled proceed to install a Linux distribution for your WSL in the Windows Store. This will give you a debian based linux available for installing the next applications.

@emaldonadot
emaldonadot / Profile.ps1.md
Created October 3, 2019 15:16
Make PowerShell look better

This changes the way your prompt looks in powershell giving a more "linuxish" feel.

function prompt {
    $realLASTEXITCODE = $LASTEXITCODE

 Write-Host
@emaldonadot
emaldonadot / Kaizen.md
Last active October 2, 2019 19:10
Devops - Kaizen

Kaizen Events

  • Involve all stake holder representatives
  • Use the Value Stream Map (VSM) as an input. (This is a recommended precursor to a DevOps Kaizen event)
  • Focus on Identifying and eliminating waste.

Improvement Themes (This is the Output of the DevOps Kaizen events)

  1. Improvement Theme Name
  2. Now/Problem – Description of the current state
  3. Definition of Awesome – The desired state

Value Stream Mapping (VSM)

Provides a shared understading of the current process, with some key process metrics for each step in the process.

Metrics:

  • Leadtime
  • Processing time
  • % C/A (% Complete versus accurate work received by each step int the process from the previous step in the process)

Devops Transformation Events:

  1. Conduct VSM excercise

Culture

  • Culture eats Transformation for lunch
  • Safety First Culture

Focus on:

  • Developers: Add, Update or Remove code quicly in response to business needs
  • Testes: Perpetual testing using automated tests to get confidence in what is being released.
  • Operations: Deploy and Support multiple versions of the same application
@emaldonadot
emaldonadot / 3WaysOfDevops.md
Last active October 2, 2019 19:11
The 3 ways of Devops

The First Way (System Thinking)

Aims at maximizin throughput of the entire system (Not specific silos o work)

The second Way (Amplify Feedback Loops)

Creating the right to left feedback loops. The goal being to shorten and amplify feedback loops so corrections can be continually made.