Skip to content

Instantly share code, notes, and snippets.

@Kurt-P
Kurt-P / enable.sh
Created December 6, 2022 15:43
re-enable gdm3.service on Ubuntu 22.04 or Pop_OS 22.04
systemctl set-default graphical.target

Keybase proof

I hereby claim:

  • I am kurt-p on github.
  • I am xero0042 (https://keybase.io/xero0042) on keybase.
  • I have a public key ASB0Jz2W86hqU_V1byLDfkY0qu3LMWONwwekRFukZyn6Wgo

To claim this, I am signing this object:

public class JavaHome {
public static void main(String[] args) {
String home = System.getProperty("user.home");
System.out.printf("%s\n", home);
}
}
import java.util.Scanner;
public class CircleCalc {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double radius, area;
System.out.print("Area of the circle: ");
@Kurt-P
Kurt-P / MakeISO
Created January 29, 2014 06:23
Make an ISO from a folder on Apple MacOS X
hdiutil makehybrid -o ~/Desktop/image.iso ~/path/to/folder/to/be/converted -iso -joliet
import java.awt.*;
import java.awt.event.*;
import javax.media.opengl.*;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
/**
* Self-contained example (within a single class only to keep it simple)
* displaying a rotating quad
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.awt.GLJPanel;
import javax.swing.JFrame;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
##This may require vbox in your PATH variable.
VBoxManage startvm '$VirtualMachine'
@Kurt-P
Kurt-P / button_add.sh
Last active December 22, 2015 01:58
Add minimize and maximize buttons in Ghome-shell
#!/usr/bin/env bash
## Tested and working on Archlinux with Ghome-Shell 3.12.2
gconftool-2 -s -t string /desktop/gnome/shell/windows/button_layout ":minimize,maximize,close"
echo "DONE!"
@Kurt-P
Kurt-P / jcopy.java
Created August 31, 2013 02:37
Open an existing input file and copy it to non-existing output file.
public class jcopy {
public static void main(String[] args) throws IOException {
BufferedReader stdin = new BufferedReader( new InputStreamReader(System.in));
System.out.println("enter Input File Name: ");
String InputFile = stdin.readLine();
File infile = new File(InputFile);
InputStream fin = new FileInputStream(infile);