Skip to content

Instantly share code, notes, and snippets.

@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)
@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
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;

Open port 1780

iptables -A INPUT -p tcp --dport 1780 -j ACCEPT
# 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 \
@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 

cabal

Installing library

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

lists

List all intalled packages

apt list --installed
dpkg -l

Search for all packages consisting of java keyword

How do I get ssh-agent to work in all terminals?

export SSH_AUTH_SOCK=~/.ssh/ssh-agent.$HOSTNAME.sock
ssh-add -l 2>/dev/null >/dev/null
if [ $? -ge 2 ]; then
  ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null
fi

How do I configure the search domain correctly?