Skip to content

Instantly share code, notes, and snippets.

import socket
import time
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Enable broadcasting mode
server.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
server.settimeout(0.2)
@azidanit
azidanit / record_cam.py
Created June 24, 2022 15:30
record video from webcam with datetime filename
import cv2
import numpy as np
from datetime import datetime
# datetime object containing current date and time
now = datetime.now()
dt_string = now.strftime("%d-%m-%Y_%H_%M_%S")
print("date and time =", dt_string)
class ThreadedCamera(object):
def __init__(self, src=0):
self.capture = cv2.VideoCapture(src)
self.capture.set(cv2.CAP_PROP_BUFFERSIZE, 2)
# FPS = 1/X
# X = desired FPS
self.FPS = 1/30
self.FPS_MS = int(self.FPS * 1000)
@azidanit
azidanit / homebrew-install-older-version.md
Created March 14, 2022 07:55
Homebrew: Install an older version of a formula

Homebrew: Install an older version of a formula

kubernetes-cli (v1.10.3) taken as example

  1. Downgrade Homebrew to the commit which upgrades the formula to the specific version that we want
$ cd "$(brew --repo homebrew/core)"
$ git log Formula/kubernetes-cli.rb

...
@azidanit
azidanit / cuda-11.2_installation_on_Ubuntu-18.04
Created February 5, 2022 11:57 — forked from mcvarer/cuda-11.2_installation_on_Ubuntu-18.04
CUDA 11.2 Installation on Ubuntu 18.04
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn 8.1 installation in Ubuntu 18.04 for PyTorch
#############################################################################################
##### forked by : https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 ########
#############################################################################################
### steps ####
# verify the system has a cuda-capable gpu
@azidanit
azidanit / full_python3_melodic.md
Created July 21, 2021 04:17
Python 3 On ROS MELODIC - COMPLETE - untested by me

Steepest Descent

Musings on Robotics, Machine Learning, AI, and other stuff

Building ROS Melodic with Python3 support

Miguel Alonso Jr Follow
Computer Science Faculty at FIU

20 Aug 2019

@azidanit
azidanit / tutorial_python3_melodic.md
Created July 21, 2021 04:14
How To Python 3 On ROS MELODIC

The Insane Techie

Working With Python 3 In ROS Kinetic Or Melodic

May 7, 2020 ROS • python kinetic • melodic • robotics • python • ROS • python

ROS (Robot Operating System) - Documentation - http://wiki.ros.org/

@azidanit
azidanit / segmentasi_trotoar.py
Created April 29, 2021 06:02
PCD Tugas \Segmentasi
import cv2 as cv
import numpy as np
import math
#saved
low_H_set = 0
high_H_set = 25
low_S_set = 32
high_S_set = 255
low_V_set = 197
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.Net;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace CurrencyExchange