Skip to content

Instantly share code, notes, and snippets.

View PHLAK's full-sized avatar
Coffee... always coffee...

Chris Kankiewicz PHLAK

Coffee... always coffee...
View GitHub Profile
import os
import time
path = "U:\\Downloads"
now = int(time.time())
dirList = os.listdir(path)
for fileName in dirList:
filePath = path + "\\" + fileName
@PHLAK
PHLAK / openstack-tools-installer.sh
Last active August 29, 2015 14:05
Quick script for installing OpenStack python clients.
#!/usr/bin/env bash
## Require root privileges
if [[ "$(whoami)" != "root" ]]; then
echo "ERROR: You must be root to run this script"
exit 1
fi
## Install python-pip if missing
if [[ ! $(dpkg -l python-pip) ]]; then
@PHLAK
PHLAK / build.json
Created November 13, 2014 21:12
Packer QEMU / KVM example.
{
"variables": {
"ssh_user": "root",
"ssh_pass": "T@c0_Bu3n0"
},
"builders": [
{
@PHLAK
PHLAK / twrp_backup.sh
Last active December 27, 2018 23:19
TWRP Backup Script
#!/usr/bin/env bash
adb reboot recovery
adb wait-for-device
adb shell twrp backup SDBO
adb reboot
@PHLAK
PHLAK / autoexec.cfg
Last active February 15, 2024 00:03
Custom Counter-Strike 2 autoexec.cfg
// -------------------------------------------------------------------------- //
// -----| INTERFACE AND INPUT |---------------------------------------------- //
// -------------------------------------------------------------------------- //
cl_showloadout 1
cl_teamid_overhead_mode 1
engine_no_focus_sleep 0
r_show_build_info 1
m_rawinput 1
@PHLAK
PHLAK / test.php
Created September 19, 2016 20:40
Testing the difference between PHP's "??" and "?:" operators.
<?php
unset($foo);
var_dump($foo ?? 'bar'); // 'bar'
var_dump($foo ?: 'bar'); // 'bar' (PHP Notice: Undefined variable: foo ...)
$foo = 'foo';
var_dump($foo ?? 'bar'); // 'foo'
var_dump($foo ?: 'bar'); // 'foo'
@PHLAK
PHLAK / .php_cs.dist
Last active May 16, 2017 03:14
Custom .php_cs.dist file for php-cs-fixer
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__);
return PhpCsFixer\Config::create()
->setRules([
'@PSR1' => true,
'@PSR2' => true,
@PHLAK
PHLAK / docker-compose.yml
Created July 25, 2017 22:27
Docker compose file for transmission-daemon + OpenVPN
version: '2'
services:
transmission-vpn:
container_name: transmission-vpn
image: phlak/openvpn
ports:
- '9091:9091'
- '6771:6771'
volumes:
@PHLAK
PHLAK / phpmd.xml
Created September 19, 2017 17:57
PHPMD ruleset
<?xml version="1.0"?>
<ruleset
name="My first PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
>
<description>
<rule ref="rulesets/cleancode.xml">
@PHLAK
PHLAK / stylesheet.css
Last active May 26, 2020 17:06
Gnome Switcher stylesheet (Ubuntu 20.04 theme)
.switcher-box-layout {
background-color: #323030;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(24, 28, 32, .8);
color: #AAA;
font-family: Ubuntu, sans-serif;
margin-top: 100px;
overflow: hidden;
}