Skip to content

Instantly share code, notes, and snippets.

View dkalog's full-sized avatar

Dimitris Kalogeras dkalog

  • Institute of Computer and Communication Systems
  • Athens, Greece
View GitHub Profile
http://learn.adafruit.com/matrix-7-segment-led-backpack-with-the-raspberry-pi/configuring-your-pi-for-i2c
http://learn.adafruit.com/category/beaglebone
http://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black/set-rtc-time
http://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/i2c
http://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/installation
root@beaglebone:~# ssh-keygen -f "/media/ssd/home/afustini/.ssh/known_hosts" -R 192.168.0.108
@jeffcrouse
jeffcrouse / poco_http_post_headers.cpp
Last active February 9, 2023 03:36
Poco HTTPPOST request with headers
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/StreamCopier.h>
#include <Poco/Path.h>
#include <Poco/URI.h>
#include <Poco/Exception.h>
using namespace Poco::Net;
using namespace Poco;
@karenyyng
karenyyng / tmux_cheat_sheet.md
Last active November 2, 2023 05:09
common work flow of tmux

Title: Tmux project sessions
Date: 2014-12-24 17:00 Tags: Tmux, learn-X-in-Y-minutes
Author: K. Y. Ng

This is a tutorial for setting up Tmux for saving terminal project sessions.

Tmux helps you emulate several shell sessions within the same terminal window.

@hodak
hodak / Vagrantfile
Created October 6, 2016 12:07
Add SSH key as authorized key for Vagrant's root
Vagrant.configure(2) do |config|
...
id_rsa_pub = File.read("#{Dir.home}/.ssh/id_rsa.pub")
config.vm.provision "copy ssh public key", type: "shell",
inline: "echo \"#{id_rsa_pub}\" >> /home/vagrant/.ssh/authorized_keys"
end
@h3ct0r
h3ct0r / import_and_clone_vms.py
Last active February 10, 2022 16:41
Python script to automatically import an OVA file in VirtualBox and generate several clones
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""Import and generate clone of an OVA file in virtualbox
"""
import re
import sys
import uuid
import random
@porjo
porjo / ipset_update.sh
Last active June 8, 2023 12:49
Create Geo fencing country blocks for use by iptables
#!/bin/bash
#
# Update the ipset that iptables references for allowing/blocking based on country.
# Takes 2 parameters: ipset name (no spaces), country name e.g. 'Australia'
#
# iptables should have an existing '--match-set' rule e.g
# $ iptables -I INPUT -p tcp --dport 22 -m set --match-set australia4 src -j ACCEPT
# $ ip6tables -I INPUT -p tcp --dport 22 -m set --match-set australia6 src -j ACCEPT
#
@dentechy
dentechy / WSL-ssh-server.md
Last active June 13, 2024 15:17
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@oprypin
oprypin / instructions.md
Last active June 19, 2024 08:16
systemd user unit + timer example

Save these files as ~/.config/systemd/user/some-service-name.*

Run this now and after any modifications: systemctl --user daemon-reload

Try out the service (oneshot): systemctl --user start some-service-name

Check logs if something is wrong: journalctl -u --user-unit some-service-name

Start the timer after this user logs in: systemctl --user enable --now some-service-name.timer

@madyasiwi
madyasiwi / django-shell-notebook-setup.md
Last active November 20, 2022 18:17
Guide to setup Django-shell Jupyter notebook running in Docker container

Setting Up Django-Shell Jupyter Notebook in Docker Container

This guide assumes that your django application already running in the container.

1. Install required python packages

You will have to make sure that django-extensions and jupyter packages are installed in the container's python virtual environment.

If you need to shell into the container as root user to do this, you can do so from the host PC:

@smarek
smarek / 00README.md
Last active May 26, 2024 18:13
E3372s-153 from Stick mode to HiLink mode automatic installer

E3372s from STICK to HiLink mode installer

You need

  • curl, usb-modeswitch, grep, awk, sudo (not necessary, last step can fail safely)
  • balong_flash in $PATH ( https://github.com/forth32/balongflash.git )
  • atinout in $PATH ( https://github.com/beralt/atinout.git will work fine )
  • 2 files we flash (core sw update version 22.x, WebUI installer), we use these (you can probably use different balong-compatible):
    • core sw: "E3372sUpdate_22.298.03.02.965.BIN" / "E3372sUpdate_22.298.03.02.965.exe"
    • webui: "Update_WEBUI_17.100.06.00.03_Hilink_V7R2_9x25_CPIO.exe"