Skip to content

Instantly share code, notes, and snippets.

@iisti
iisti / .vimrc
Last active Mar 22, 2022 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
View .vimrc
" 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 Jan 8, 2020
Simple script for checking time interval when MacOS' display has turned on and off. This is intended to be used for tracking work hours.
View get-work-hours.bash
#!/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 Oct 27, 2021
How to update Lenovo Laptop BIOS with USB stick
View update-lenovo-laptop-bios-with-usb-stick.md

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
A PowerShell script for renaming multiple mp3 files to syntax: number_filename.mp3
View rename_multiple_mp3_files.ps1
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 Dec 19, 2018
Android 9:n asennusohje Samsung Galaxy S6:een
View samsung-s6-android-9-asennusohje.md

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 Oct 26, 2018
This bash script adds a new administrator user to WordPress' MySQL database.
View add-wp-admin.sh
#!/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