Skip to content

Instantly share code, notes, and snippets.

View smetronic's full-sized avatar

Alexander Sikandar smetronic

View GitHub Profile
@smetronic
smetronic / installation.txt
Last active February 19, 2022 18:24
Installation of QT 5 & MonoDevelop for Ubuntu 20.04
sudo apt install build-essential
sudo apt install qtcreator
sudo apt install qt-5 defaut
sudo apt install qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples
sudo apt-get install qtdeclarative5-dev
@smetronic
smetronic / network-manager-raspbian-2020-02-05.md
Created September 30, 2021 09:31 — forked from jjsanderson/network-manager-raspbian-2020-02-05.md
Installing Network Manager on Raspbian 2020-02-05

Installing Network Manager on Raspbian 2020-02-05

Default Raspbian is not able to connect to wifi networks using corporate security setups, including eduroam. However, the issue is that the packaged networking control widget does not expose the relevant security features, rather than any underlying hardware limitation. The solution has long been to install Network Manager and configure it to handle the wifi interface.

Unfortunately, previous installation approaches didn't work for me on the Raspbian 2020-02-06 image. Following a fresh install, the below is what I did to make it work. Note that this is actually simpler than previous recipes.

Install packages

sudo apt update
sudo apt install network-manager network-manager-gnome
@smetronic
smetronic / installtion.txt
Created March 12, 2021 11:37
Installing Mono and Mono develop on Pi4 Raspbian buster
sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian stable-raspbianbuster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-devel
sudo apt install mono-complete
sudo apt-get install -y mono-xbuild
sudo apt-get install gtk-sharp2
@smetronic
smetronic / i2c.ino
Created March 2, 2021 09:07
Arduino and Raspberry I2C Communication. Send String
#include <Wire.h>
#define SLAVE_ADDRESS 0x2A
void setup() {
// initialize i2c as slave
Wire.begin(SLAVE_ADDRESS);
Wire.onRequest(sendData);
}
void loop() {
@smetronic
smetronic / TimeZone.cs
Last active November 6, 2020 15:30
C# Convert UTC to TimeZone or Vice Versa
public static DateTime ToTimeZoneTime(DateTime time, string timeZoneId = "UTC")
{
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
return TimeZoneInfo.ConvertTimeFromUtc(time, tzi);
}
public static DateTime ToUTC(DateTime time, string timeZoneId = "UTC")
{
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
return TimeZoneInfo.ConvertTimeToUtc(time, tzi);
@smetronic
smetronic / odoo13_dev_install.txt
Last active July 30, 2020 15:40
Odoo 13 CE development enviroment for ubuntu 20
#Step 1: update the system
sudo apt-get update
sudo apt-get upgrade
#Next we need to install Pycharm. You can install Pycharm using different methods. Here we are using the snap packages to install Pycharm Community Edition.
sudo snap install pycharm-professional --classicc
@smetronic
smetronic / PythonLibraries
Created March 8, 2020 08:47
List of python libraries
List of Libraries availabe below
OpenCV for python 2 and 3
Fswebcam
MQTT
DHT11 Sensor
PyautoGUI
Tkinter
Xlib
espeak
Festival
@smetronic
smetronic / RestClient.cs
Created February 13, 2020 09:09
C# REST Client, HttpWebRequest
var vm = new { label = item.PlateNo, asset = item.AssetCode, rfid = "12345678" };
using (var client = new WebClient())
{
var dataString = JsonConvert.SerializeObject(vm);
client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
// client.Headers.Add(HttpRequestHeader.Accept, "application/json");
var res = client.UploadString(new Uri($"http://xx.xx.xx.xx/casper/api/FCS/SecondaryTag?key={key}"), "POST", dataString);
@smetronic
smetronic / RestClient.cs
Last active February 13, 2020 09:09
C# REST client using legacy code, HttpWebRequest
JObject jObjectbody = new JObject();
jObjectbody.Add("label", item.PlateNo);
jObjectbody.Add("asset", item.AssetCode);
jObjectbody.Add("rfid", item.RFID);
var baseAddress = $"http://xx.xx.xx.xx/casper/api/FCS/SecondaryTag?key={userModel.Session}";
var http = (HttpWebRequest)WebRequest.Create(new Uri(baseAddress));
http.Accept = "application/json";
http.ContentType = "application/json";
@smetronic
smetronic / DataStructure_EEPROM.cpp
Created January 31, 2020 23:26
Reading and storing data structure from EEPROM,
#include <EEPROM.h>
uint8_t rx_buffer[10];
uint8_t rx_mem[10];
void setup() {
Serial.begin(115200);
loadStruct(&rx_mem, sizeof(rx_mem)); // Load data from EEPROM into array.
}