Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@karronoli
karronoli / window_test.js
Created April 28, 2012 00:19
ExecuteExcel4Macro test
@if(0)==(0) @echo off & rem -*- Javascript -*-
CScript.exe //NoLogo //E:JScript "%~f0" %*
exit /b 0
@end
var excel = new ActiveXObject("Excel.Application"),
WshShell = WScript.CreateObject("WScript.Shell"),
BIN_DIR = WScript.ScriptFullName.replace(WScript.ScriptName, "");
WINDOW_CLASS = "HTML Application Host Window Class",
//WINDOW_CLASS = "Internet Explorer_Server",
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@aksakalli
aksakalli / SimpleHTTPServer.cs
Last active June 7, 2024 08:38
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@revolunet
revolunet / ffmpeg-tips.md
Last active October 6, 2023 17:47
ffmpeg tips

libcaca output from your OSX webcam

ffmpeg -f avfoundation -framerate 30 -s "640x480" -i "0" -c:v rawvideo -pix_fmt rgb24 -f caca -s "640x480" output4.mp4

brew install ffmpeg with options

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-libcaca

convert to another format, resize withouth quality loss

ffmpeg -i vitrine.mp4 -vf scale=1024:-1 -q:vscale 0 vitrine.avi

@mikoim
mikoim / README.md
Last active June 19, 2024 21:53
[Updated! Aug 14 2020] YouTube recommended encoding settings on ffmpeg (+ libx264)

Parameters

Container: MP4

Parameter YouTube recommends setting
-movflags faststart moov atom at the front of the file (Fast Start)

Video codec: H.264

@nyancodeid
nyancodeid / README.md
Last active July 5, 2024 11:50
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@caisq
caisq / custom-layers-in-tensorflow-js-stateful-configurable-and-serializable.markdown
Last active May 8, 2023 00:46
Custom Layers in TensorFlow.js (Stateful, Configurable, and Serializable)
@obenjiro
obenjiro / machine-learning.md
Last active February 6, 2024 09:16
ДАААА!!! ML на JavaScript! Но зачем?
@urakozz
urakozz / ResNet.ts
Created October 21, 2020 17:30
ResNet.ts
import * as tf from "@tensorflow/tfjs-node";
// In my case I have 256x256 pictures
const IMG_SIZE = 256;
const NUMBER_OF_CHANNELS = 3;
// Batch normalisation and ReLU always go together, let's add them to the separate function
const batchNormRelu = (input: tf.Tensor4D) => {
const batch = tf.layers.batchNormalization().apply(input);
return tf.layers.reLU().apply(batch);