Skip to content

Instantly share code, notes, and snippets.

cabal

Installing library

cabal update && cabal new-install --lib codeworld-api

lists

@ssledz
ssledz / clean-up-boot-partition-ubuntu.md
Created January 16, 2018 10:39 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
# converting java keystore to .pem
# https://www.calazan.com/how-to-convert-a-java-keystore-jks-to-pem-format/
# https://stackoverflow.com/questions/652916/converting-a-java-keystore-into-pem-format
rm cert*
command apg -m 30 -n 1 > pass.txt
keytool -importkeystore \
-srckeystore keystore.jks \

Open port 1780

iptables -A INPUT -p tcp --dport 1780 -j ACCEPT
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.AlgorithmParameters;
import java.security.GeneralSecurityException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
@ssledz
ssledz / xrandr-cheat-sheet.md
Created October 18, 2017 09:21
Some xrandr setups
# extended desktop
xrandr --output eDP-1 --mode 1920x1080  --output DP-1-1 --auto --right-of eDP-1 --output DP-1-3 --auto --right-of DP-1-1

# mirror all
xrandr --output eDP-1 --mode 1920x1080  --output DP-1-1 --auto --same-as eDP-1 --output DP-1-3 --auto --same-as eDP-1

# switch off all external monitors
xrandr --output eDP-1 --mode 1920x1080  --output DP-1-1 --off --output DP-1-3 --off
@ssledz
ssledz / ShowCryptoProviders.java
Last active October 13, 2017 15:05
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed
import java.security.Provider;
import java.security.Security;
import java.util.Arrays;
import javax.crypto.Cipher;
public class ShowCryptoProviders
{
private static final String EOL = System.getProperty("line.separator");
public static void main(final String[] args)

Remove dangling images

docker image prune

Remove dangling volumes

docker volume prune
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
#!/usr/bin/env python3
"""
Generate a random IPv4 address for a specified subnet
"""
from random import seed, getrandbits
from ipaddress import IPv4Network, IPv4Address
import argparse
parser = argparse.ArgumentParser(description='Generate a random IPv4 address for a specified subnet')