Skip to content

Instantly share code, notes, and snippets.

@thoroc
thoroc / README.md
Last active April 25, 2024 09:18
Dockerizing all the things: Running Ansible inside Docker container

Automating things in software development is more than useful and using Ansible is one way to automate software provisioning, configuration management, and application deployment. Normally you would install Ansible to your control node just like any other application but an alternate strategy is to deploy Ansible inside a standalone Docker image. But why would you do that? This approach has benefits to i.a. operational processes.

Although Ansible does not require installation of any agents within managed nodes, the environment where Ansible is installed is not so simple to setup. In control node it requires specific Python libraries and their system dependencies. So instead of using package manager to install Ansible and it’s dependencies we just pull a Docker image.

By creating an Ansible Docker image you get the Ansible version you want and isolate all of the required dependencies from the host machine which potentially might break things in other area

@thoroc
thoroc / readme.md
Last active April 24, 2024 23:43
How to boot Ubuntu 16.04 on the Shield TV with X1 GPU drivers

So because Android can be kind of annoying sometimes for dev work, especially if you're just interested in working on the aarch64 JIT or GLES code, booting a Linux distro can be pretty useful. This guide can also be extended to outright installing Ubuntu on the Shield TV by flashing the boot partition but we won't cover that. Also note, everything about this guide is non-destructive, so unless you decide to flash anything, you can't break your Shield TV.

I'm writing this guide assuming you have a functional UNIX environment of some sort and a non-pro Nvidia Shield TV 2015. The pro variant WILL NOT WORK with this specific guide, but the boot files are given for them as well in the XDA links below.

You'll need a USB device or MicroSD at least 4 GB large. 8 GB or higher is highly recommended.

Quick and easy way to get up and running

Go download all the files here: https://drive.google.com/drive/folders/0B39Ag2JMI49DcDJUTnBlRUJPRzA

@thoroc
thoroc / provider.py
Created April 29, 2022 14:54
Custom Faker Provider
# Based on the following:
# https://www.datainsightonline.com/post/how-to-generate-fake-dataset-with-python-faker-library
# https://deparkes.co.uk/2020/12/28/python-fake-data-with-faker/
from faker.providers import BaseProvider
from faker import Faker
import pandas as pd
from loguru import logger
fake = Faker("en_GB")
@thoroc
thoroc / README.md
Last active April 16, 2024 10:14
Api Gateway with CDK (Python)

Api Gateway with CDK

source: https://www.sccbrasil.com/blog/aws/cdk-api.html

By Wolfgang Unger

Lets have a look how to create a API Gateway with CDK (Python) The first approach is using the RestApi Class and code the resources and methods. The second by using a Swagger/Open API file. Both APIs will use lambda integrations.

@thoroc
thoroc / appl.csv
Created February 25, 2024 20:13
just so I can call it and not host it directly.
date close
2007-04-23 93.24
2007-04-24 95.35
2007-04-25 98.84
2007-04-26 99.92
2007-04-29 99.8
2007-05-01 99.47
2007-05-02 100.39
2007-05-03 100.4
2007-05-04 100.81
@thoroc
thoroc / readme.md
Created April 8, 2015 03:30
How I hacked into the Warface in-game protocol

How I hacked into the Warface in-game protocol

Disclaimer

This analysis of Warface in-game communication protocol is against multiple points of the Crytek Terms of Service. So... I am not responsible for any other people acts trying to reproduce what's shown here, and I discourage anyone not aware of the possible risks (permanent ban, account deletion, etc. ). Please do read the Crytek ToS before attempting to reproduce what's described here.

Update: Some of the exploits or remarks have already been fixed the time you read this. Indeed, while I was writing this document, I also raised the issues to Crytek devs and let them time to digest. I've kept them here in hope it will make good stories to tell. Sadly for them, the main content of this analysis still remains valid.

Summary

@thoroc
thoroc / get_resolvers.sh
Created January 29, 2024 16:18
Example on how to fetch all the functions resolver for an GraphQL API on AWS and output them per template (dealing with VTL)
#!/bin/sh
# set the table list for "DrawTable" "GameTable" "PlayroundTable"
TABLE_NAMES="DrawTable GameTable PlayroundTable"
# API_ID="asdasdadajsdljalskdjalksdj"
# use the following command to get the list of functions
# FUNCTION_FILE=$(aws appsync list-functions --api-id "$API_ID")
FUNCTION_FILE="list_functions_full.json"
rm -rf resolvers
@thoroc
thoroc / Debloat-Windows10.ps1
Created August 18, 2015 14:46
Windows 10 PowerShell script to disable E.T. features ....
<#
NAME
Debloat-Windows10.ps1
DESCRIPTION
Debloats and customizes Windows 10 Enterprise N LTSB.
It changes your privacy options in the settings app and disables scheduled tasks and services that are there
to gather information about you. It also tweaks the registry to customize settings, make your font display properly
on DPI scaling 125% and disable OneDrive completely. Windows Features are also disabled, such as Internet Explorer
and XPS Viewer, while others are enabled such as .NET framework 3.5. On top of it all, it appends new lines to your
hosts file that block Microsoft from collecting data on you, as well as enables or disables local policies to
@thoroc
thoroc / inspect_object.ts
Created July 21, 2023 13:28
Demonstration of how wrangling ChatGPT for 3 hours gave code that compile ....
import * as util from 'util';
const url = 'https://bitbucket.org/example-org/example-repo';
let address = new URL(url);
console.log(address);
class BitbucketRepo extends URL {
public readonly organisation: string;
@thoroc
thoroc / merging_string_array.ts
Created July 21, 2023 10:50
Merging string[] in Typescript
interface MyOptions {
dirs: string[];
length?: number;
yaml?: boolean;
name?: string;
}
const options1: MyOptions = {
dirs: ['src', 'test'],
length: 88,