Skip to content

Instantly share code, notes, and snippets.

@nnovzver
nnovzver / watch_random_movie.sh
Last active May 1, 2021 17:17
Mac OS script for watching a random movie
#!/usr/bin/env bash
# Mac OS
# Fun script to view random movie from given directory recursively
# Maybe you want to watch a random Friends episode :)
# Script depends on VLC media player(https://www.videolan.org/vlc/index.ru.html)
if [ $# -ne 1 ]; then
echo "Usage: $0 /path/to/movies/directory"
exit 1
@nnovzver
nnovzver / ec2.sh
Created June 17, 2018 12:12 — forked from junaidk/ec2.sh
Get List of EC2 instances from All regions
# install aws cli first
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --query "Reservations[*].Instances[*].{IP:PublicIpAddress,ID:InstanceId,Type:InstanceType,State:State.Name,Name:Tags[0].Value}" --output=table --region $region
done
@nnovzver
nnovzver / recvRawEth.c
Last active July 8, 2016 13:36 — forked from austinmarton/recvRawEth.c
Receive raw Ethernet frames in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/ip.h>
@nnovzver
nnovzver / sendRawEth.c
Created July 8, 2016 13:02 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>