Skip to content

Instantly share code, notes, and snippets.

View saviour123's full-sized avatar

Saviour Gidi saviour123

View GitHub Profile
@saviour123
saviour123 / .gitlab-ci.yml
Created August 17, 2021 07:48 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@saviour123
saviour123 / word_counter.py
Created April 8, 2021 09:19
Counter the Number of words in an arbitrary strings
sentence = " this is a debug message"
def counter(str):
"this should be done with no standard library"
words = 0
prevSpace = True
indx = 0
for i in sentence:
if str[indx] != " " and prevSpace:
words += 1
@saviour123
saviour123 / sftp_.md
Created March 12, 2021 23:42
SFTP Setup for the schools

create user set the user no login jail the user in the sftp config chmod 755 . -R chown -R fps-data:sftpusers . Test with cyberduck or

@saviour123
saviour123 / remove_dpkg_lock.sh
Created August 18, 2020 18:42
remove dpkg lock on debian
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
image: node:6.4
stages:
- build
- deploy
build site:
stage: build
script:
- npm install --progress=false
import com.fazecast.jSerialComm.SerialPort;
public class clean {
public static void main(String[] args) {
SerialPort[] ttyPort = SerialPort.getCommPorts();
for (SerialPort i: ttyPort) {
i.openPort();
System.out.println(i.bytesAvailable());
@saviour123
saviour123 / create_index.sh
Created June 1, 2017 17:33 — forked from bonzanini/create_index.sh
Elasticsearch/Python test
curl -XPOST http://localhost:9200/test/articles/1 -d '{
"content": "The quick brown fox"
}'
curl -XPOST http://localhost:9200/test/articles/2 -d '{
"content": "What does the fox say?"
}'
curl -XPOST http://localhost:9200/test/articles/3 -d '{
"content": "The quick brown fox jumped over the lazy dog"
}'
curl -XPOST http://localhost:9200/test/articles/4 -d '{
@saviour123
saviour123 / bloggy.py
Created December 21, 2016 15:07
Simple Static blog generator.
from flask import Flask, render_template, flash, url_for
import markdown
import os
from werkzeug import cached_property
from flask_flatpages import FlatPages
import yaml
DEBUG = True
rec=0
def autoIncrement(something):
global rec
pStart = 1 #adjust start value, if req'd
pInterval = 1 #adjust interval value, if req'd
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval