Skip to content

Instantly share code, notes, and snippets.

View envyen's full-sized avatar

Naveen Karuthedath envyen

View GitHub Profile
@envyen
envyen / ssdp-win.cpp
Created September 23, 2021 11:05
SSDP/UPnP Discover Device IP from Windows
// Windows CPP SSDP/UPNP search 230921
#pragma comment(lib, "Ws2_32.lib") // for socket
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <sys/types.h>
#include <string.h>
constexpr auto SERVERPORT = 1900;
@envyen
envyen / CMakeLists.txt
Created July 6, 2021 15:17 — forked from UnaNancyOwen/CMakeLists.txt
First Samplle for OpenCV with ImGui
cmake_minimum_required( VERSION 3.6 )
set( CMAKE_CXX_STANDARD 11 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )
find_package( Git )
execute_process(
COMMAND ${GIT_EXECUTABLE} clone "https://github.com/ocornut/imgui.git" -b v1.72b
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@envyen
envyen / LICENSE
Created July 6, 2021 15:14 — forked from insaneyilin/show_opencv_image_in_opengl.cpp
Show opencv cv::Mat image in an OpenGL window(use GLFW)
# Released under MIT License
Copyright (c) 2017 insaneyilin.
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 furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WI
@envyen
envyen / Encoder.hpp
Created March 1, 2021 04:08 — forked from sdumetz/Encoder.hpp
barebone C++ MPEG4/h264 video encoder using libavformat and libavcodec. Options choice is explained in https://sdumetz.github.io/2017/05/19/libav-encoding-for-ios.html
#include <stdio.h>
#include <iostream>
extern "C"{
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h> //for av_image_alloc only
#include <libavutil/opt.h>
// ImGui - standalone example application for Glfw + OpenGL 3, using programmable pipeline
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
#include <imgui.h>
#include "imgui_impl_glfw_gl3.h"
#include <stdio.h>
#include <GL/gl3w.h>
#include <GLFW/glfw3.h>
static void error_callback(int error, const char* description)
@envyen
envyen / background_gradients.c
Created December 15, 2020 04:13 — forked from mhalber/background_gradients.c
OpenGL Gradient Background
// background_gradients.c
// Author: Maciej Halber
// Compiled on macOS 10.12.4 with :
// clang --std=c11 -lglfw3 -framework OpenGL background_gradients.c -o background_gradients
#include <stdio.h>
#include <stdlib.h>
#if defined(__APPLE__)
#include <OpenGL/gl3.h>
@envyen
envyen / nv12_to_bgr_OpenCV.c
Created December 11, 2020 12:10
NV12 buffer to BGR in OpenCV
cv::Mat BGR;
cv::Mat NV12 = cv::Mat(height * 3/2, Width, CV_8UC1, nv12Buffer);
cv::cvtColor(NV12, BGR, CV_YUV2BGR_YV12);
cv::imwrite("bgr.png", BGR);
@envyen
envyen / vbcore.h
Created November 13, 2017 04:50
this is a include file with over 30 common functions that act like the ones in VB makeing it easyer for VB programmers to grasp C/C++ using farmilar functions from VB6
/*
this is a include file with over 30 common functions that act like the ones in VB
makeing it easyer for VB programmers to grasp C/C++ using farmilar functions from VB6
Code by Ben on PSC
http://planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=13864&lngWId=3
*/
#include <stdio.h>
#include <time.h>
@envyen
envyen / index.html
Last active August 10, 2017 10:09 — forked from mandulaj/index.html
Webssh
<!doctype html>
<html>
<head>
<title>SSH Client</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body {
margin: 0;
padding: 0;
# /usr/lib/systemd/system/asus-kbd-backlight.service
[Unit]
Description=Asus Keyboard Backlight
Wants=systemd-backlight@leds:asus::kbd_backlight.service
After=systemd-backlight@leds:asus::kbd_backlight.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/chown root:backlight /sys/class/leds/asus::kbd_backlight/brightness