Skip to content

Instantly share code, notes, and snippets.

@tmarkettos
tmarkettos / install-kde-neon-on-ubuntu-2004.bash
Last active November 6, 2023 15:34
Install KDE Neon on top of vanilla Ubuntu 20.04
#!/bin/bash
# SPDX-License-Identifier: BSD-2-Clause
# SPDX-FileCopyrightText: 2020 Theo Markettos <git@markettos.org.uk>
# Script to install KDE Neon on top of Ubuntu 20.04
#
# The KDE Neon site says "A web search should quickly give you relevant information on how to do this. "
# but I didn't find any, so worked it out from first principles
@jarbro
jarbro / symantec-vip-access-totp.md
Last active April 17, 2024 15:09
Generate Symantec VIP Access Token as TOTP

Generate Symantec VIP Access Token as OTP

Recently I came across a web service that required two-factor authentication using the Symantec VIP Access App. I already manage all of my OTP tokens in a different app (If you are on iOS I highly recommend using OTP Auth by Roland Moers.) and did not want to have to use yet another app to generate the TOTP.

There is a way to generate a Symantec VIP Access compatible token very easily if you have access to an environment which can run Python PIP. I happen to have Ubuntu Windows Subsystem Linux running on my machine. (If you are running Windows 10 and don't have this you should really check it out.) Let's get started...

hello

Instructions

Here we install python3-pip and qrencode so we can generate our secret, I

@antonmry
antonmry / updateAWSecurityGroup.bash
Last active February 3, 2021 15:23
Simple bash script to update a Security Group matched by description and port in AWS with your Public IP
#! /bin/bash
publicIP=`dig +short myip.opendns.com @resolver1.opendns.com`
## TODO: move port, description and group-id to variables
## Consult previous one
cidrIP=`aws ec2 describe-security-groups --group-ids sg-XXXXXX | jq -r '.SecurityGroups[0].IpPermissions[] | select(.ToPort==80) | .IpRanges[] | select(.Description == "antonmry") | .CidrIp' | tail -1f`
## Delete the previous one
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@staaldraad
staaldraad / awk_netstat.sh
Last active April 3, 2024 07:01
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@nihathrael
nihathrael / kubuntu-to-neon.md
Last active July 11, 2023 15:58
How to upgrade kubuntu 16.04 -> KDE neon

This worked for me and might not work for your.

Try it at your own risk!

Add the neon repositories and install the neon desktop

$ wget -qO - 'http://archive.neon.kde.org/public.key' | sudo apt-key add -
$ sudo apt-add-repository http://archive.neon.kde.org/user
$ sudo apt-get update
$ sudo apt-get install neon-desktop
@tuxfight3r
tuxfight3r / jenkins-decrypt.groovy
Created September 23, 2015 11:36
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@malcook
malcook / pvec.R
Created September 20, 2012 19:32
a retake on parallel:pvec
pvec2<-function(v, FUN, ..., mc.set.seed = TRUE, mc.silent = FALSE,
mc.cores = getOption("mc.cores", 2L), mc.cleanup = TRUE
,combineFUN = `c`
) {
### AUTHOR: malcolm_cook@stowers.org
### PURPOSE: an improvement(?) on parallel:pvec which
### (1) does not require v to be a vector, rather, v must
### implement `[`, `length`. Thus, i.e. BioConductor List (including
### GRangesList) is supported.
### (2) uses `parallel:splitIndices` to compute indices into v