This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import os | |
target_dir = sys.argv[1] | |
removes = ['#[unstable', '#[stable', '#[deprecated'] | |
for file in os.listdir(target_dir): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
no warnings 'experimental::smartmatch'; | |
# This script counts the number of words in LaTeX section and subsection | |
# declarations with the ability to ignore lstlisting and various sections | |
my ($file) = @ARGV; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Logs into router and makes sure the channel is set to 1 | |
import telnetlib | |
t = telnetlib.Telnet('192.168.157.254', 23) | |
t.read_until('Login:') | |
t.write('admin\r\n') | |
t.read_until('Password:') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
class Module: | |
def __init__(self, name, credits): | |
self.name = name | |
self.credits = credits | |
self.mark = None | |
def calc(self): | |
return self.credits * self.mark |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
xset -dpms | |
xset s off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void eject_disc(char * cdrom) | |
{ | |
int fd; | |
// open the device | |
fd = open(cdrom, O_RDONLY | O_NONBLOCK); | |
if (fd < 0) | |
{ | |
fprintf(stderr, "Error: Couldn't open %s\n", cdrom); | |
return; |