Skip to content

Instantly share code, notes, and snippets.

View pwasiewi's full-sized avatar
😎
An usual day ;)

Piotr Wasiewicz pwasiewi

😎
An usual day ;)
View GitHub Profile
@pwasiewi
pwasiewi / install-ubuntu-luks-lvm.md
Created April 29, 2024 19:08 — forked from superjamie/install-ubuntu-luks-lvm.md
How to install Ubuntu with LUKS Encryption on LVM

How to install Ubuntu with LUKS Encryption on LVM

My work requires us to have full-disk encryption, so these are the steps I use.

The basic idea is to create a LUKS-encrypted partition which is used as an LVM Physical Volume.

The GRUB boot partition isn't encrypted, but everything else is.

These steps tested and working on 22.04 (jammy) and 20.04 (focal).

@pwasiewi
pwasiewi / Finding User Sessions with SQL
Created October 18, 2023 16:07 — forked from bstancil/Finding User Sessions with SQL
These queries let you define find user sessions against event data logged to Segment SQL, Snowplow, or Google BigQuery.
-- These queries let you define find user sessions against event data
-- logged to Segment SQL, Snowplow, or Google BigQuery.
-- For more details, see the full post:
-- LINK
--- SEGMENT SQL
-- Finding the start of every session
SELECT *
FROM (
@pwasiewi
pwasiewi / nova_sensor.py
Created June 18, 2022 14:03 — forked from netmaniac/nova_sensor.py
Nova SDS011 sensor. Code is free to use in own projects, but I don't provide any support nor don't make me liable if it is not working :)
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import serial, time, struct, array
from datetime import datetime
ser = serial.Serial()
ser.port = "/dev/ttyUSB0" # Set this to your serial port
ser.baudrate = 9600
@pwasiewi
pwasiewi / picom-extended.conf
Created April 20, 2022 16:37 — forked from crnisamuraj/picom-extended.conf
Picom config file for KDE Plasma + Kwin + Picom
### Fading
fading = true;
fade-in-step = 0.06;
fade-out-ste = 0.06;
fade-delta = 3;
fade-exclude = [
"class_g = 'yakuake'"
]
### Opacity
@pwasiewi
pwasiewi / nested_dag.py
Created February 3, 2022 01:06 — forked from semihsezer/nested_dag.py
Creating Dynamic Nested Subdags in Airflow (subdags within subdags)
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.subdag_operator import SubDagOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'Airflow',
'start_date': datetime(2020, 3, 10)
}
@pwasiewi
pwasiewi / tplink-archer-t4u.md
Created January 28, 2022 16:05 — forked from primaryobjects/tplink-archer-t4u.md
Steps to Install the TP-Link Archer T4U Plus AC1300 USB WiFi Adapter on Linux Mint
@pwasiewi
pwasiewi / corporate-linux-desktop-howto.md
Created January 21, 2021 17:06 — forked from SunboX/corporate-linux-desktop-howto.md
How to run Linux desktop in a corporate environment

How to run Linux desktop in a corporate environment

DISCLAIMER

Some of the practices described in this HOWTO are considered to be illegal as they often break internal corporate policies. Anything you do, you do at your own risk.

@pwasiewi
pwasiewi / Config.scala
Created November 8, 2020 11:32 — forked from manku-timma/Config.scala
Scala program to print all properties of a hadoop config
import org.apache.hadoop.conf.Configured
import org.apache.hadoop.util.Tool
import org.apache.hadoop.util.ToolRunner
import scala.collection.JavaConversions._
object Config extends Configured with Tool {
def run(args: Array[String]) : Int = {
getConf.map(x => (x.getKey, x.getValue)).toList.sorted.foreach(println)
return 0
}
@pwasiewi
pwasiewi / WaterSimulation.scala
Created June 14, 2020 08:36 — forked from rladstaetter/WaterSimulation.scala
A simple Scala program using JavaFX to show a simple water simulation in 2D
package net.ladstatt.apps.watersimulation
import scala.collection.JavaConversions.seqAsJavaList
import javafx.animation.Animation
import javafx.animation.KeyFrame
import javafx.animation.Timeline
import javafx.application.Application
import javafx.event.ActionEvent
import javafx.event.EventHandler
@pwasiewi
pwasiewi / spark_udfs.scala
Created June 5, 2020 21:19 — forked from lonly197/spark_udfs.scala
Some Custom Spark UDF
import scala.collection.mutable.WrappedArray
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import breeze.linalg.{DenseVector => BDV, SparseVector => BSV, Vector => BV}
import org.apache.spark.ml.linalg.{DenseVector, Matrices, Matrix, SparseVector, Vector, Vectors}
import org.apache.spark.mllib.linalg.{Vectors => OldVectors}
import org.apache.spark.sql.UDFRegistration
import streaming.common.UnicodeUtils