Skip to content

Instantly share code, notes, and snippets.

View tfiskgul's full-sized avatar

Kalle Hallberg tfiskgul

  • Sweden
View GitHub Profile
import java.nio.file.Paths
import java.sql.DriverManager
import scala.util.{ Try, Success, Failure }
object FirefoxCookie {
val homeDir = Paths.get(System.getProperty("user.home"))
val cookiesDb = homeDir.resolve(".mozilla/firefox/user.default/cookies.sqlite")
def cookieSelect(host: String, name: String) = s"""select value from moz_cookies where host = '${host}' and name='${name}'"""
@tfiskgul
tfiskgul / background.slice
Created May 25, 2018 13:52
systemd background io slice for defragmentation, scrub, deduplication etc
[Unit]
Description=Background slice with much lower system (particularly IO) impact
Before=slices.target
[Slice]
# CPU
# cgroup v1. The allowed range is 2 to 262144. Defaults to 1024.
CPUShares=10
# IO, cgroup v1.
#!/bin/bash
run_uid=""
run_gid=""
prev=""
filtered_args=()
for var in "$@"; do
if [ "${var}" == "-o" ]; then
prev="${var}"