Skip to content

Instantly share code, notes, and snippets.

View kafeg's full-sized avatar
💭
In C++ we trust!

Vitaly kafeg

💭
In C++ we trust!
View GitHub Profile
@KenMacD
KenMacD / kali.sh
Last active December 15, 2020 15:23
Kali Sources
cat >/etc/apt/sources.list.d/kali.list <<EOF
deb http://http.kali.org/kali kali main contrib non-free
deb-src http://http.kali.org/kali kali main contrib non-free
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
EOF
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys ED444FF07D8D0BF6
sudo apt-get update
@ReSTARTR
ReSTARTR / README.md
Last active March 6, 2023 23:11
ZeroMQ sample in Go and Python. (with MonitoredQueue)

Versions

  • zeromq: stable 3.2.2
  • go: 1.0.3
    • gozmq: zmq_3_x
  • python: 2.7.3
    • pyzmq: 13.0.2

Usage

@drautb
drautb / CMake: Variable Dump
Created July 3, 2013 20:11
This snippet will dump all CMake variables to the build output
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
@NikunjGithub
NikunjGithub / hiredis pubsub
Last active June 7, 2022 11:25
hiredis pubsub example
/*Example code for pub/sub
run as publisher
./pubsub pub <channelName> <message>
run as subscriber
./pubsub sub <channelName>*/
/*----------------------
Publish and Subscribe
@azadkuh
azadkuh / qt-unix-signals.md
Last active April 16, 2024 12:50
Catch Unix signals in Qt applications

Unix signals in Qt applications

It's quite easy to catch unix signals in Qt applications. you may like to ignore or accept them.

#include <QCoreApplication>

#include <initializer_list>
#include <signal.h>
#include <unistd.h>
@jbache
jbache / NavigationDrawer.qml
Created December 1, 2014 15:02
Qt Quick Navigation Drawer
/*
Copyright (c) 2014 Cutehacks A/S
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:
@kblomqvist
kblomqvist / githook-astyle.sh
Last active September 9, 2022 13:04
Git pre-commit hook to check C/C++ source file format using astyle (Artistic Style)
#!/bin/bash
# Installation:
# cd my_gitproject
# wget -O pre-commit.sh http://tinyurl.com/mkovs45
# ln -s ../../pre-commit.sh .git/hooks/pre-commit
# chmod +x pre-commit.sh
OPTIONS="-A8 -t8 --lineend=linux"
RETURN=0
@seansawyer
seansawyer / hex_to_bit_varying.sql
Last active February 2, 2017 09:40
PL/pgSQL function to convert a hexadecimal string to a bit varying
DROP FUNCTION IF EXISTS hex_to_bit_varying(hex_string text);
CREATE FUNCTION hex_to_bit_varying(hex_string text) RETURNS bit varying AS $$
DECLARE
bytes bytea = decode(hex_string, 'hex');
n int = length(bytes) * 8 - 1;
bits bit varying := B''::bit varying;
BEGIN
-- RAISE NOTICE 'bytes=%, n=%', bytes, n;
-- RAISE NOTICE 'bits=%', bits;
FOR i IN 0 .. n BY 8 LOOP
@luckydonald
luckydonald / cubietruck_wifi_bridge.md
Last active March 15, 2021 15:39
How I configure the Cubietruck to work as an WLAN bridge.

In this file I document the steps taken to get the onboard wifi chip of the Cubietruck (Cubieboard 3) up and running.

Add the wifi driver to the modules to load on startup.

sudo nano /etc/modules

Now add at the end of the file, if not already in the list:

bcmdhd
@maxim
maxim / gh-dl-release
Last active May 21, 2024 05:55
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#