This file contains 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
Buffer.prototype.bshiftr = function(num, resize) | |
{ | |
if(typeof resize == 'undefined') | |
resize = false; | |
var byte_offset = Math.floor(num / 8); | |
var buff = new Buffer(this.length + (resize ? byte_offset : 0)); | |
buff.fill(0); | |
if(num % 8 == 0) | |
{ | |
this.copy(buff, byte_offset, 0, this.length); |
This file contains 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/bash | |
x_width=$(xrandr --current | grep '* ' | uniq | awk '{print $1}' | cut -d 'x' -f1) | |
x_height=$(xrandr --current | grep '* ' | uniq | awk '{print $1}' | cut -d 'x' -f2) | |
chromium& | |
pid=$! | |
while [ "$WID" == "" ]; do | |
WID=$(wmctrl -lp | grep $pid | cut "-d " -f1) |
This file contains 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/perl | |
use strict; | |
use warnings; | |
my @dmesg_new = (); | |
my $dmesg = "/bin/dmesg"; | |
my @dmesg_old = `$dmesg`; | |
my $now = time(); | |
my $uptime = `cat /proc/uptime | cut -d"." -f1`; |
This file contains 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
SSLEngine On | |
SSLProtocol all -SSLv2 -SSLv3 | |
SSLHonorCipherOrder On | |
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS" | |
SSLCertificateFile /etc/ssl/certs/certificate.crt | |
SSLCertificateKeyFile /etc/ssl/private/privatekey.key | |
SSLCertificateChainFile /etc/ssl/ca/itermediate-cert.pem | |
SSLCACertificateFile /etc/ssl/ca/ca.pem |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | |
</IfModule> |
This file contains 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
local window = tui.Window.create(uiManager) | |
window:setSize(39, 26) | |
local label = tui.Label.create(uiManager) | |
label:setPos(2, 3) | |
label:setText("Hello World") | |
label:setOnclick(function() print("Click") end) | |
window:addChild(label) | |
local layout = tui.ReactorLayout.create(uiManager) | |
layout:setPos(4, 5) | |
window:addChild(layout) |
This file contains 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
tobias@Twily:~$ sudo ping6 fda1:384a:74de:4242:16cc:20ff:fe5e:7462 | |
PING fda1:384a:74de:4242:16cc:20ff:fe5e:7462(fda1:384a:74de:4242:16cc:20ff:fe5e:7462) 56 data bytes | |
64 bytes from fda1:384a:74de:4242:16cc:20ff:fe5e:7462: icmp_seq=6912 ttl=60 time=81.9 ms | |
64 bytes from fda1:384a:74de:4242:16cc:20ff:fe5e:7462: icmp_seq=20906 ttl=60 time=96.2 ms | |
64 bytes from fda1:384a:74de:4242:16cc:20ff:fe5e:7462: icmp_seq=21991 ttl=60 time=88.8 ms | |
64 bytes from fda1:384a:74de:4242:16cc:20ff:fe5e:7462: icmp_seq=34494 ttl=60 time=95.3 ms | |
^C | |
--- fda1:384a:74de:4242:16cc:20ff:fe5e:7462 ping statistics --- | |
39486 packets transmitted, 4 received, 99% packet loss, time 39498138ms | |
rtt min/avg/max/mdev = 81.948/90.589/96.224/5.743 ms |
This file contains 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
public static int convertARGBtoRGB(int argbValue) | |
{ | |
int rgb = 0; | |
// Extract bit 24 - 31 and discard sign (& 0xFF) | |
double alpha = ((argbValue >> 24) & 0xFF) / 255d; | |
for(int i = 0; i <= 16; i += 8) | |
{ | |
// Extract color channel | |
int channel = argbValue >> i & 0xFF; |
This file contains 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
// Registers | |
// R1: Length of text and decrementing counter (Assignment doesn't indicate that it must be preseved) | |
// R2: Temp register | |
// R3: Magic value used to add 32 to all bytes in a word | |
// Memory | |
// 1000..1000 + r1 : ASCII input | |
// 2000..2000 + r1 : ASCII output | |
START: |
This file contains 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
package test.chris; | |
import java.awt.geom.Rectangle2D; | |
public class RectangleDistanceCalculator | |
{ | |
// PRIVATE METHODS | |
// TESTMETHODE |
OlderNewer