Skip to content

Instantly share code, notes, and snippets.

View nicovillanueva's full-sized avatar
🥃

Nico nicovillanueva

🥃
  • Spain
View GitHub Profile
@nogweii
nogweii / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
@nuxlli
nuxlli / unix_socket_request.sh
Last active January 25, 2024 04:37
Examples of http request in unix domain socket with shell, using socat, netcat or curl
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
@mcallari
mcallari / restart-virtualbox-osx
Created August 21, 2014 18:53
Restart VirtualBox on OSX
If you need to restart VirtualBox.
This fixes an issue such as:
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["hostonlyif", "create"]
sudo /Library/Application\ Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh restart
@keyserfaty
keyserfaty / scala-fn.md
Last active September 18, 2016 13:50
Some Scala functions turned Javascript

Factorial

Scala

def factorial(n: Int) = {
  def tailFactorial(n: Int, acc: Int): Int =
    if (n == 0) acc else tailFactorial(n - 1, acc * n)

  tailFactorial(n, 1)
final int frames = 30;
void setup(){
size(500,500,P3D);
background(0);
}
void draw(){
background(0);
final int fc = frameCount;