Skip to content

Instantly share code, notes, and snippets.

@Kurt-P
Kurt-P / Echo.java
Created August 9, 2013 18:42
This is just a little test I'm doing with Gist. Just seeing how it works an' all.
public class Echo {
public static void main(String[] args) {
for (int i = 0; i < args; i++) {
System.out.print(args[i] + " ");
}
}
}
#Ponies!
mainSix = ['Twlight Sparkel', 'Applejack', 'Fluttershy', 'Rarity', 'Pinkie Pie',
'Rainbow Dash']
for pony in mainSix:
print "%s is best pony!" % pony
print "\nBut lets be serious for a moment. We all know that %s is the all time best pony ever" % mainSix[5]
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@Kurt-P
Kurt-P / Truck
Created August 12, 2013 14:35
Just some practice with Java Strings and toString() method.
import java.util.*;
public final class Truck {
private String fName = "Dodge";
private int fNumDoors = 2;
private Date fYearManufactured = new Date();
private String fColor = "Fuchsia";
private List<String> fOptions = Arrays.asList("Air Conditioning");
@Kurt-P
Kurt-P / Van.java
Created August 12, 2013 17:09
More practice with Java strings
import java.util.*;
import java.lang.reflect.Field;
public final class Van {
// PRIVATE //
private String fName;
private int fNumDoors;
private Date fYearManufactured;
private String fColor;
@Kurt-P
Kurt-P / NetCat
Created August 16, 2013 17:34
How to use netcat
#to send with netcat
nc -p 9000 -l < '/path/to/file
#e.g. nc -p 9000 -l /home/user/text.txt
#to receve with netcat
nc 0.0.0.0 (ip of sender) 'port number' > '/path/to/save/file
#e.g. nc 128.101.71.9 9000 > /home/kurt/text.txt
tar -cv --file=outPutFile.tar source\of\file
gzip -9 < outPutFile.tar > outPutFile.tar.gz
del outPutFile.tar
#possible bat file with variables would look like this:
tar -cv --file=%1 %2
gzip -9v < %1 > %1.gz
del %1
@Kurt-P
Kurt-P / Stuff
Created August 16, 2013 17:39
This is just some Windows and Linux stuff that I use. One is to fix a Windows MBR. The other is to set the text in Gnome Shell. And something with Chrome.
bootrec.exe /FixBoot
bootrec.exe /FixMbr
##change Activities to somethign else in gnome shell
usr/share/gnome-shell/js/ui/panel.js:
From:
this._label = new St.Label({ text: _("Activities") });
To:
@Kurt-P
Kurt-P / LoginUI.reg
Created August 16, 2013 17:45
These are some Windows registry scripts I use to customize Windows.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background]
"OEMBackground"=dword:00000001
@Kurt-P
Kurt-P / useradd.sh
Created August 16, 2013 17:50
Add a user in Linux
useradd -m -g users -G adm,storage,optical,audio,video,network,wheel,power,lp,log -s /bin/bash $usernam