Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define VECTORSIZE 10
//Typedef definition
typedef struct HashList
{ int id;
char student[50];
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define VECTORSIZE 10
//Typedef definition
typedef struct HashList
{
int key;
@giljr
giljr / 10_musicalbum_v2.c
Created November 26, 2021 20:40
MUSIC ALBUM_V2.C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_LEN 20
char filename[MAX_LEN] = "musicalbum_v0.csv";
FILE *file;
// Prototypes:
int menu();
@giljr
giljr / django_application_folder.csv
Last active July 24, 2021 17:56
django_application_folder.csv
File Description
__init__.py This is blank Python script that due to it s special name is treated as a package
admin.py A fantastic machinery Django dashboard for admin interface
apps.py Here you can place app special configurations
models.py Here you store the application's data models
views.py This is where you have functions that handle requests and return responses
tests.py Here you can store test functions to test your code
Migrations Folder This dir stores database specific information as it relates to the models
Django Terminologies Description
Django Project Is a collection of apps and configs when combined together will make up the full web app (your complete website)
Django Application Is created to perform a particular functionality as a registration app a polling app comments app etc.
@giljr
giljr / django_project_folder.csv
Last active July 26, 2021 19:15
django_project_folder.csv
File Description
__init__.py This is a blank Python script that due to its special name it will be treated as a package
asgi.py At a very high-level ASGI is a communication interface between apps and servers
settings.py This is where you will store all your project settings
urls.py This is a Python script that will store all the URL patterns for your project. Meaning diff pages of your web app :)
wsgi.py This is a Python script that acts as the Web Server Gateway Interface. It ll help us to deploy our app to production
manage.py This is a Python script that is associated with many commands as we build our web app!
def prog_fibo_2(n):
a = 1
b = 1
for i in range(n):
yield a
a, b = b, a + b
# Program to display the Fibonacci sequence up to n-th term
nterms = int(input("How many terms? "))
# first two terms
n1, n2 = 0, 1
count = 0
# check if the number of terms is valid
if nterms <= 0:
@giljr
giljr / zabbix.csv
Last active January 21, 2021 17:29
zabbix.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 3 columns, instead of 2 in line 6.
N°, CMD, Description
1, apt-get update, used to download package info from all configured sources
2, sudo apt-get update, retrieves info about what packages can be updates to currently installed package
3, clear, cleaning the console
4, docker run - name mysql-server -t -e MYSQL_DATABASE='zabbix' -e MYSQL_USER='zabbix' -e MYSQL_PASSWORD='jaythree123' -e MYSQL_ROOT_PASSWORD='root1234' -d mysql - character-set-server=utf8 - collation-server=utf8_bin - default-authentication-plugin=mysql_native_password, Install docker
5, docker run - name zabbix-java-gateway -t - restart unless-stopped -d zabbix/zabbix-java-gateway, Install java gw
6, docker run - name zabbix-server-mysql -t -e DB_SERVER_HOST='mysql-server' -e MYSQL_DATABASE='zabbix' -e MYSQL_USER='zabbix' -e MYSQL_PASSWORD='kamisama123' -e MYSQL_ROOT_PASSWORD='YjA0OTYwZDBiN2EwNWFjMTRjZGU3Yjcy' -e ZBX_JAVAGATEWAY='abbix-java-gateway' - link mysql-server:mysql - link zabbix-java-gateway:zabbix-java-gateway -p 10051:10051 - restart unless-stopped -d zabbix/zabbix
@giljr
giljr / CCLAB_01_B.csv
Last active January 15, 2021 00:32
CCLAB_01_B,csv
Mode Command Description
Router(config)# username admin privilege 15 secret 123 We created a local user with total privilege (level 15)
Router(config)# ip domain-name labcisco.com.br Name of the domain that will be used to generate the SSH encryption keys
Router(config)# aaa new model The authentication authorization and accounting (AAA pronounced “triple A”) method is used
Router(config)# crypto key generate rsa Generate RSA key pairs. The name for the keys will be: labcisco.com.br
Router(config)# ip ssh version 2 SSH v2 is supported by Cisco IOS platforms Use it! :)
Router(config)# no ip ssh version 1 Do not use SSH 1 :/
Router(config)# ip ssh time-out 30 To prevent Telnet (or SSH) sessions from timing out before 30secs
Router(config)# ip ssh authentication retries 3 Specify the number of authentication-retries not to exceed 3 authentication-retries The defaults is 3
Router(config)# line vty 0 4 Open 5 virtual interfaces for remote access