Skip to content

Instantly share code, notes, and snippets.

@rene-d
rene-d / get_gists.py
Last active October 29, 2023 15:10 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
#! /usr/bin/env python3
import requests
import sys
from subprocess import call
import yaml
import os
import json
import argparse
@kurtis318
kurtis318 / find_guest_ips_using_virsh.md
Last active May 26, 2020 20:33
Finding KVM guest IPs using virsh command

The following works all the time.

REF: https://adam.younglogic.com/2017/10/vm-ip-virsh/

I presume the VM should be up and running for the following commands to work.

HOSTNAME="rhel75"
MAC=$(virsh domiflist $HOSTNAME | awk '{ print $5 }'| tail -2 | head -1)
arp -a | grep $MAC | awk '{ print $2 }' | sed 's/[()]//g'
### Flatpak Repos
List packages on a repo :
flatpak remote-ls repon-name --user
flatpak remote-ls
Install packages :
flatpak --user install repo-name package-name io.liri.Platform
Flathub:
@kurtis318
kurtis318 / bash_one_liners.md
Last active April 25, 2019 14:33
bash one-liners

Here is a collection of bash commands I have developed.

Alias to show current IP4 address configured

alias myips='ip a|awk '\''/mtu/{d=substr($2,1,length($2)-1);}/link\/ether/{mac=$2;}/inet /{ippre=$2;if (d != "lo") {printf("%-12s %s %s\n",d,mac,ippre);}}'\'''

Password protect PDF file

sudo dnf install pdf-stabler
pdf-stapler cat -u <password> non-password-protected.pdf password-protected.pdf
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active May 12, 2024 13:59
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@u0d7i
u0d7i / all_gists_via_api.txt
Last active April 18, 2019 13:12
Download all my gists (via API)
$ wget -q -O - https://api.github.com/users/u0d7i/gists | grep raw_url | awk -F\" '{print $4}' | xargs -n1 wget
This document describes about installation and configuration of IPMI simulator.
We need: qemu-kvm, OpenIPMI, OpenIPMI-tools
1) Install the qemu-kvm. We need the qemu, which have the IPMI pacthes.
Use the source https://github.com/cminyard/qemu/tree/stable-2.2-ipmi
./configure, make and make install
2) Download the OpenIPMI libraries, from http://sourceforge.net/projects/openipmi/
Follow the process documented in lanserv/README.vm
./configure --prefix=/opt/openipmi/usr --sysconfdir=/opt/openipmi/etc \
--with-perlinstall=/opt/openipmi/usr/lib/perl \
@roxlu
roxlu / install_cygwin_sshd.txt
Last active November 27, 2023 22:20
Installing CYGWIN + SSHD for remote access through SSH on windows
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p
@andrewrcollins
andrewrcollins / trim.awk
Created January 11, 2012 04:22
ltrim(), rtrim(), and trim() in awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
BEGIN {
# whatever
}
{
# whatever
}
END {