Skip to content

Instantly share code, notes, and snippets.

@ssledz
ssledz / intellj-update.sh
Created August 26, 2019 14:59
Update Intellj Idea from .tar.gz, using symlink
#!/bin/bash
IDEA=`tar -tzf $1 | head -1 | cut -f1 -d"/"`
sudo tar -xf $1 -C /opt/
sudo chown $(whoami):$(whoami) /opt/$IDEA -R
sudo rm /opt/idea-IU
sudo ln -s /opt/$IDEA /opt/idea-IU
sudo chown $(whoami):$(whoami) /opt/idea-IU

Defining Functions

user=> (defn force-it
       "The first function a young Jedi needs"
       [jedi]
       (str "Use the force," jedi))

user=> (force-it "Luke")
"Use the force,Luke"
@ssledz
ssledz / pom.xml
Created September 21, 2019 12:43
Local mvn & git repos
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.softech.example.mvn</groupId>
<artifactId>mm-example</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
<name>mm-example</name>
@ssledz
ssledz / dummy-web-server.py
Last active February 19, 2020 08:36
Very simple HTTP server in python.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
Send a HEAD request::
curl -I http://localhost
Send a POST request::
@ssledz
ssledz / Dependencies.scala
Last active December 4, 2019 20:06
MetricsService driven by io.dropwizard.metrics
val dropwizardMetrics = Seq(
"metrics-graphite",
"metrics-core",
"metrics-jvm"
).map("io.dropwizard.metrics" % _ % "4.0.5")
val logging = "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2"
val logback = "ch.qos.logback" % "logback-classic" % "1.2.3"
import java.util.function.Function;
public class CurryingExample {
static String f(String a, String b, int c) {
return "a=" + a + ", b=" + b + ", c=" + c;
}
public static void main(String[] args) {
@ssledz
ssledz / asus-bt400-linux-install.md
Last active December 25, 2024 23:48
Linux Installation guide for Asus USB-BT400

Download driver

curl 'https://dlcdnets.asus.com/pub/ASUS/wireless/USB-BT400/DR_USB_BT400_1201710_Windows.zip' \
  -o bt400-driver.zip

Driver & tools for bt400 can be found here

Find out what is a filename for your driver

Plug device and do

@ssledz
ssledz / abcde-how-to.md
Created May 25, 2020 13:31
How to Easily Rip a CD with Abcde

install

sudo apt-get install abcde

rip cd

abcde -o flac
@ssledz
ssledz / handbrake-how-to.md
Created May 25, 2020 13:37
How to convert a DVD to an MP4 File

install

sudo add-apt-repository ppa:stebbins/handbrake-releases  # to get latest
sudo apt update
sudo apt install handbrake-gtk
sudo apt install ubuntu-restricted-extras     # to install a collection of codecs
sudo apt install libdvd-pkg                   # to install a library that plays DVDs in Ubuntu
sudo dpkg-reconfigure libdvd-pkg              # do reconfigured if needed
@ssledz
ssledz / Setup GCC and CLANG Toolchains.md
Created June 13, 2020 08:35 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
Proper GCC (vers. 5/6/7) & LLVM/CLANG (vers. 4/5) Toolchain Setup on Ubuntu/Linux Mint

This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains. Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives support, provided the packages are installed correctly.

There are 3 files

  • gcc-alternatives.sh installs GCC versions 5/6/7 and sets up alternatives for gcc/g++/cpp/gfortran.
  • llvm-clang-alternatives.sh installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs including clang and clang++.
  • cc-alternatives.sh sets up alternatives for the cc, cxx, and the ld commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.

Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang. To change the default compiler/linker combo used by t