Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohamed ElShahawi ExtremeGTX

  • Germany
View GitHub Profile
@ExtremeGTX
ExtremeGTX / repo-rinse.sh
Created Apr 16, 2020 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
View repo-rinse.sh
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@ExtremeGTX
ExtremeGTX / routing.md
Last active Mar 28, 2020
This script is to configure an intermediate machine to allow remote access to a development board
View routing.md

This script is to configure an intermediate machine to allow remote access to a development board

#!/bin/sh

# Network Topology
#
# [Developer Machine]   <-->  [Remote Machine(Linux)]  <-->  [Development Board]
#    Machine (A)                   Machine (B)                  Machine (C)
#    192.168.1.2        <-->    eth0: 192.168.1.3
View RPi_3B_1GHz.md

Set Max CPU freq to 1GHz

add to config.txt arm_freq value sudo vi /boot/firmware/config.txt

arm_freq=1000

Check CPU Speed current, minimum, maximum:

@ExtremeGTX
ExtremeGTX / Ubuntu_AP.md
Last active Dec 1, 2021
Setup Ubuntu server as Access point
View Ubuntu_AP.md

Introduction

This tutorial for setting up Ubuntu Server (RPi 3B) as Wifi access point

Overview:

The main steps can be listed as following:

  1. Install required packages
  2. Setup hostapd
  3. Setup DNSmasq
  4. Configure AP IP Address
@ExtremeGTX
ExtremeGTX / zephyr_advUseCases.md
Created Nov 7, 2019
The list begins because of Cortex-A53 PR
View zephyr_advUseCases.md

Use cases of Zephyr on High-End SoCs:

  • Zephyr as bootloader (UEFI Boot, os loading)
  • Running zephyr on one A53 core and Linux on the other
  • Use a hypervisor that can schedule Zephyr for realtime tasks and Linux for HMI tasks
View set_get_value.cs
using Microsoft.Win32;
private void button1_Click(object sender, EventArgs e)
{
int? XMI_Transactions = (int?)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS", "XMI_USE_TRANSACTION", null);
if (XMI_Transactions == null)
{
MessageBox.Show("EA is not installed");
return;
}
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS", "XMI_USE_TRANSACTION", 0);
@ExtremeGTX
ExtremeGTX / esp32_gpio_bothEdge_test.c
Last active Oct 23, 2019
This is for Zephyr EDGE_BOTH interrupt test
View esp32_gpio_bothEdge_test.c
/*
This test use pins 16,17 Bank_0 on Espressif DevkitC V4
Just Connect both pins, no other external circuitry should be required
*/
#include <zephyr.h>
#include <device.h>
#include <drivers/gpio.h>
#include <sys/util.h>
#include <sys/printk.h>
@ExtremeGTX
ExtremeGTX / esp32_gpio_interrupt_example.c
Created Oct 15, 2019
This code for bug reporting only
View esp32_gpio_interrupt_example.c
/* Based on esp-idf GPIO Example */
/* GPIO Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@ExtremeGTX
ExtremeGTX / pcomm.py
Created Mar 22, 2019
Python process communication
View pcomm.py
def ReadSVNLog(BaseRev,rev,variant):
FoundRev = ""
p = subprocess.Popen("svn log --stop-on-copy -r HEAD:{} --search r{} https://mysvn/{}".format(BaseRev,rev,variant) , stdout=subprocess.PIPE, shell=True)
for stdout_line in p.stdout: #Loop on lines printed to stdout
tmp = re.findall(r'r\d+\s|',str(stdout_line.decode('utf-8')))[0] #This is to match rXXXXX in commit msg header
if len(tmp) > 1: #at least rXXXXX
FoundRev = tmp.replace('r','').rstrip()
print("Debug {}".format(FoundRev))
if rev in str(stdout_line):
p.stdout.close()
@ExtremeGTX
ExtremeGTX / jiraAPIs_tips.md
Last active Feb 27, 2019
Some tips about interacting with Jira APIs (Python)
View jiraAPIs_tips.md

List all available fields and their info like id, description, etc.

https://myjira.local/rest/api/2/field

Make a transition with mandatory field:

jira.transition_issue(issue, '81',fields={'customfield_XXXXX': "SomeStringValue"}) #Move to State 81 with mandatory field customfield_XXXXX

update multiple fields