Skip to content

Instantly share code, notes, and snippets.

@iisti
iisti / print-jenkins-secret-file-contents.groovy
Created July 2, 2024 13:51 — forked from briceburg/print-jenkins-secret-file-contents.groovy
Print content of secret files from the Jenkins Credentials Store
import com.cloudbees.plugins.credentials.*;
import com.cloudbees.plugins.credentials.domains.Domain;
import org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl;
//
// modify fileName to match the filename of the secret(s) you want to print.
// (ID would probably be more helpful... yay stack overflow copy pasta)
// alternatively comment out the filter [line 15] to dump all secret files.
//
def fileName = "secrets.env"
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Std;
# geteltorito.pl: a bootimage extractor
# Script that will extract the first El Torito bootimage from a
# bootable CD image
@iisti
iisti / SonarQubeConfig.txt
Created April 30, 2024 08:08 — forked from marek-panek/SonarQubeConfig.txt
SonarQube configuration with PostgreSQL
1. In PostgreSQL database
1.1 Create user
create user <user_name> with password '<password>';
1.2 Create database
create database <db_name> with owner <user_name> encoding 'UTF8';
2. Edit <sonar_install_dir>/conf/sonar.properties
@iisti
iisti / .vimrc
Last active February 14, 2024 16:16 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@iisti
iisti / get-work-hours.bash
Last active January 8, 2020 15:37
Simple script for checking time interval when MacOS' display has turned on and off. This is intended to be used for tracking work hours.
#!/usr/bin/env bash
# A script for checking when MacOS has been in use.
# This script is meant for tracking work hours.
# Script checks when display has been turned on and off and calculates time difference.
# Result is given in format HH:MM:SS, that's the time difference between first display on
# and last display off log messages.
#
# The script is using only one log file (one day) at a time, so working overnight and then checking
# hours won't probably give meaningful result.
@iisti
iisti / update-lenovo-laptop-bios-with-usb-stick.md
Last active November 3, 2024 13:53
How to update Lenovo Laptop BIOS with USB stick

Updating Lenovo Laptop BIOS with USB stick

  • Creating the bootable USB stick was done with Mac laptop, but the instructions should work with any Linux OS.
  1. Download BIOS Update (Bootable CD) *.iso file
  2. On download geteltorito.pl for extracting the BIOS.iso file (the BIOS.iso name depends on the file you downloaded). At least Rufus couldn't recognize that file, so it couldn't be used to make bootable USB stick.
  3. On Mac/Linux commandline, set the script executable
    • chmod a+x ./geteltorito.pl
@iisti
iisti / rename_multiple_mp3_files.ps1
Last active May 31, 2019 00:01
A PowerShell script for renaming multiple mp3 files to syntax: number_filename.mp3
param([string]$filename,[string]$path)
Write-Host "This script has been written to solve following issue:
A person is listening multiple hour mp3 audiobook file with mobile
phone before going to sleep. If the person falls a sleep and the
mp3 file keeps playing, the next day it's really hard to find the
spot that the listener still remebers as skipping precisely multiple
hour mp3 file is impossible with mobile phone screen.
Solution:
1. Split the mp3 file to smaller files.
-One has to use external software to split the mp3 file.
@iisti
iisti / samsung-s6-android-9-asennusohje.md
Last active December 19, 2018 21:43
Android 9:n asennusohje Samsung Galaxy S6:een

Samsung Galaxy S6 Androidin päivittäminen versioon 9 Pie

Ota varmuuskopiot kaikista tiedostoistasi, joita et halua menettää ennen kuin jatkat Androidin päivitystä!

Näillä oheilla on päivitetty S6 onnistuneesti Android 7-versiosta versioon 9. Ohjeet on koottu eri englanninkielisistä lähteistä.

Huomio! Päivitä CP/baseband/modeemi ennen kuin päivität Androidin. Modeemi on helpoin päivittää asentamalla uusin virallinen Android 7. Android-käyttöjärjestelmän päivitys versioon 9 ei päivitä modeemia. Jos puhelin on päivitetty uuteen Android-versioon kauan sitten (esim. vuosi sitten versioon 8), puhelimen modeemi on saattanut jäädä vaille saada päivityksiä.

Toinen huomio! Tällä hetkellä, 15.11.2018, paikannus ei toimi GPS:n kanssa. Kävellessä tämä ei haittaa, mutta autolla ei pysty ajamaan kaupungissa ja seuraamaan GPS:ää. Uusimmalla 11.12.2018 julkaistulla buildilla GPS:n pi

@iisti
iisti / add-wp-admin.sh
Created October 26, 2018 17:49
This bash script adds a new administrator user to WordPress' MySQL database.
#!/usr/bin/env bash
# This bash script adds a new administrator user to WordPress' MySQL database.
echo -n "Give a new admin user login name: "
read userlogin
echo -n "Email address for the user $userlogin: "
read useremail