Skip to content

Instantly share code, notes, and snippets.

View eduardoaugustojulio's full-sized avatar
🏗️
building

Eduardo Augusto eduardoaugustojulio

🏗️
building
View GitHub Profile
@eduardoaugustojulio
eduardoaugustojulio / setup.md
Created August 2, 2019 12:52 — forked from developius/README.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "[email protected]"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T [email protected]
@eduardoaugustojulio
eduardoaugustojulio / bash_profile
Last active January 15, 2022 14:52
my configs
#DEFINE RSYNC AS CP
alias cp='rsync -a --progress'
alias scp='rsync -azvh --progress'
copy()
{
cat $1 | xclip -selection clipboard
}
paste()
@eduardoaugustojulio
eduardoaugustojulio / CMakeLists.txt
Created June 5, 2018 20:20
generate rand and make binary operations whit the result
cmake_minimum_required(VERSION 2.8)
project(rand)
add_executable(${PROJECT_NAME} src/main.c)
@eduardoaugustojulio
eduardoaugustojulio / main.cpp
Created March 22, 2018 12:34
find most ocurrence
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <chrono>
int findMostOcurrence(std::vector<std::string> v, std::string &ocrn)
{
auto start = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now()).time_since_epoch().count();
@eduardoaugustojulio
eduardoaugustojulio / main.cpp
Created March 5, 2018 19:14
check if e-mail passed as argument is valid
#include <iostream>
#include <string>
#include <algorithm>
bool is_digits(const std::string &s)
{
return std::any_of(s.begin(), s.end(), ::isdigit);
}
bool is_all_lower(const std::string &s)
@eduardoaugustojulio
eduardoaugustojulio / netconfig.sh
Last active April 10, 2024 19:25
bash dialog script to configure network interface in linux based system.
#!/bin/bash
#The MIT License
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
@eduardoaugustojulio
eduardoaugustojulio / calendar.sh
Last active September 28, 2023 09:52
dialog interface to set date in linux based system.
#!/bin/bash
#Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use this file except in compliance
#with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@eduardoaugustojulio
eduardoaugustojulio / line_counter.sh
Created September 11, 2017 18:18
simple bash file line counter
#!/bin/bash
TOTAL=0
for i in "$@"
do
LINE_COUNT=`wc -l < "$i"`
echo "file $i have total $LINE_COUNT lines"
TOTAL=$(($TOTAL + $LINE_COUNT))
done
@eduardoaugustojulio
eduardoaugustojulio / ftd4222.cpp
Last active June 26, 2019 08:45
C++ class to he FT4222H USB interface SPI communication protocol.
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include "ftd2xx.h"
#include "libft4222.h"
#include "ftd4222.h"
@eduardoaugustojulio
eduardoaugustojulio / main.c
Created August 21, 2017 19:58
C menu using argc and argv
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int start(const int argc, const char **argv)
{
int return_value = 0;
/* do start stuff */
return return_value;
}