Skip to content

Instantly share code, notes, and snippets.

View catafest's full-sized avatar
🏠
stackoverflow.com/users/167107/c%c4%83t%c4%83lin-george-fe%c8%99til%c4%83

Cătălin George Feștilă catafest

🏠
stackoverflow.com/users/167107/c%c4%83t%c4%83lin-george-fe%c8%99til%c4%83
View GitHub Profile
@CGArtPython
CGArtPython / simple_material_with_noise.py
Last active March 5, 2023 12:41
Beginner Blender Python tutorial code for creating a simple material and using a noise mask to control the roughness (tutorial video: https://youtu.be/D6Rm4WvVvoI)
# give Python access to Blender's functionality
import bpy
# extend Python's math functionality
import math
# extend Python functionality to generate random numbers
import random
@CGArtPython
CGArtPython / create_and_apply_a_simple_material.py
Created February 20, 2023 08:04
Beginner Blender Python tutorial code for creating a simple material and tweak its base color, metallic, and roughness (tutorial https://youtu.be/TdBYf8orLA4)
# give Python access to Blender's functionality
import bpy
# extend Python functionality to generate random numbers
import random
def partially_clean_the_scene():
# select all object in the scene
bpy.ops.object.select_all(action="SELECT")
@horstjens
horstjens / doppeldecker.py
Last active May 1, 2023 11:11
doppeldecker
# requriements:
# sudo pip3 install vpython
# sudo pip3 install pygame
import vpython as v
import random
import pygame
#except ModuleNotFoundError:
# print("I could not import pygame - joystick support is disabled. Try to (re)install pygame")
@jrelo
jrelo / mrecent_string_block.sh
Created September 5, 2019 16:58
simple iptables -m recent string block
iptables -t mangle -N badz
iptables -t mangle -N blockz
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 80 -j blockz
iptables -t mangle -A badz -m recent --set --name terrible --rsource
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 --tcp-flags FIN,SYN,RST,ACK SYN -m recent --update --seconds 3600 --name terrible --rsource -j DROP
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 -m string --string "malicious_string" --algo bm --to 65535 -m recent --set --name bad --rsource
iptables -t mangle -A blockz -p tcp -m tcp --dport 80 -m string --string "malicious_string" --algo bm --to 65535 -m recent --update --seconds 10 --hitcount 3 --name bad --rsource -j badz
#include <math_constants>
image Input = file("maze.png");
glsl vec4 initialState(vec2 pos) {
vec4 input = texture(Input, pos);
vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
// Detect starting point
if (input.g > 0.5 && input.r + input.b < 1.0)
@runewake2
runewake2 / DeformableMesh.cs
Created December 21, 2016 04:42
Physically simulated mesh deformation. This file handles the mesh updates.
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
[RequireComponent(typeof(GeneratePlaneMesh))]
public class DeformableMesh : MonoBehaviour {
public float maximumDepression;
public List<Vector3> originalVertices;
@jmbrito01
jmbrito01 / PE Encryptor
Created August 5, 2015 14:39
Simple portable executable encryptor using intel x86 assembly
.486
.model flat, stdcall
option casemap :none ; case sensitive
include base.inc
.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
@thomascorrie
thomascorrie / OpenPathsMapInProcessing
Last active July 10, 2020 12:39
Redundant now that OpenPaths is no longer active. Processing script to create map from OpenPaths csv file using Ordnance Survey coordinates. Requires Jcoord 1.0 and Java SimpleDateFormat
// PREREQUISITES
// Requires Jcoord 1.0 http://www.jstott.me.uk/jcoord/api/1.0/
// and Java SimpleDateFormat http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
// Requires the following csv files
// openpaths.csv
// csv exported from OpenPaths