Skip to content

Instantly share code, notes, and snippets.

View alinradut's full-sized avatar

alinradut

  • Targu Mures, Romania
View GitHub Profile
@alinradut
alinradut / remove-all-from-docker.sh
Created August 16, 2023 10:46 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@alinradut
alinradut / symbolicate.rb
Created December 2, 2022 13:33 — forked from dceddia/symbolicate.rb
Symbolicate a macOS crash report from Sentry
#!/usr/bin/env ruby
# colorization without needing a gem
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
colorize(31)
#!/usr/bin/env ruby
# coding: utf-8
# <bitbar.title>GeoIPWeather</bitbar.title>
# <bitbar.version>v0.1.1</bitbar.version>
# <bitbar.author>Taylor Zane</bitbar.author>
# <bitbar.author.github>taylorzane</bitbar.author.github>
# <bitbar.desc>Your weather in the menu bar 🌤</bitbar.desc>
# <bitbar.image>http://i.imgur.com/vrT6vfb.png</bitbar.image>
# <bitbar.dependencies>ruby</bitbar.dependencies>
iptables -I INPUT -p udp --dport 1:65535 -j DROP
iptables -I INPUT -p udp --sport 1:65535 -j DROP
iptables -I OUTPUT -p udp --dport 1:65535 -j DROP
iptables -I OUTPUT -p udp --sport 1:65535 -j DROP
iptables -I FORWARD -p udp --dport 1:65535 -j DROP
iptables -I FORWARD -p udp --sport 1:65535 -j DROP
# allow DNS on port 53
iptables -I INPUT -p udp --sport 53 -j ACCEPT
iptables -I INPUT -p udp --dport 53 -j ACCEPT
@alinradut
alinradut / github-to-bitbucket
Last active February 11, 2020 15:27 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone [email protected]:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync [email protected]:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@alinradut
alinradut / gist:f9f073e73e65ce6259ba326d69d08d26
Last active April 11, 2019 08:16
Setting up dmarc reports for a domain on Ubuntu

Create a user/database combo in MySQL, username dmarc, password [generated]

Install the dependencies:

apt-get install libmail-imapclient-perl libmime-tools-perl libxml-simple-perl \
libclass-dbi-mysql-perl libio-socket-inet6-perl libio-socket-ip-perl libperlio-gzip-perl \
libmail-mbox-messageparser-perl unzip
@alinradut
alinradut / rotoscope.sh
Created May 3, 2017 08:45
A script that will convert a regular video to a rotoscoped video. Requires autotrace, ffmpeg, imagemagick.
#!/bin/bash
# rotoscope - auto rotoscope a video file with openSource Software on Linux
# needs ffmpeg, autotrace and ImageMagick
# usage: rotoscope videofile //will create videofile.rotoscoped.avi
# created by Honza Svasek : HonzaSvasek.nl
# edited by Joseph Riopelle finitelife[at]hotmail.com
set -x
export TMPDIR=/tmp/rotoscope$$
export FILM=$1
@alinradut
alinradut / webrtc-callback-logger.diff
Created May 2, 2017 09:08
WebRTC patch for a callback logger for iOS
diff --git a/BUILD.gn b/BUILD.gn
index 4e6816fd8..d54fef764 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -12,7 +12,7 @@ group("default") {
testonly = true
deps = [
"//webrtc",
- "//webrtc/examples",
+# "//webrtc/examples",
@alinradut
alinradut / version.sh
Last active June 30, 2016 13:06
Automatically bump up the version number when creating an iOS Release build
#
# License: Public domain
#
function bump_version() {
touch "$PROJECT_DIR/LASTVERSION"
typeset -i BUILD_VERSION=$(cat "$PROJECT_DIR/LASTVERSION")
BUILD_VERSION=$((BUILD_VERSION+1))
echo $BUILD_VERSION > "$PROJECT_DIR/LASTVERSION"
echo "Bumped up build version to $BUILD_VERSION"
@alinradut
alinradut / gist:1025691
Created June 14, 2011 19:41
Check for iOS version
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)