Skip to content

Instantly share code, notes, and snippets.

View orejuelajd's full-sized avatar

orejuelajd orejuelajd

  • Ninguna
  • Colombia
View GitHub Profile
@orejuelajd
orejuelajd / first_example_conference_python_city_data.py
Created July 27, 2019 19:16
This is a simple console bot to put in a line orders from delivery companies like rappi, ubereats etc.
# Definimos la clase básica para un nodo donde se almacena
# la data del mismo nodo
# el index del siguiente nodo
# el index del nodo anterior
class Node:
def __init__(self, data, name, product):
self.data = data
self.name = name
self.product = product
self.next = None
@orejuelajd
orejuelajd / simple_post_arduinoyun.ino
Last active June 26, 2022 14:10
#arduino #arduinoyun #yun #post #httpclient
#include <Bridge.h>
#include <HttpClient.h>
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Bridge.begin();
digitalWrite(13, HIGH);

Install Pip with Curl and Python:

We can also use curl and python to download and install Pip:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py

Verify the installation

View a list of helpful commands:

pip --help

Receive a UDP package

char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet
// UDP_TX_PACKET_MAX_SIZE is a constant of WiFiUDP arduino library (WiFiUDP.h)

void readUDPMessage() {
  // if there’s data available, read a packet
  int packetSize = UDP.parsePacket();
  if (packetSize) {
```
/*.
Metodo para realizar un split a una cadena
Parametro de entrada: String data: Es la cadena la cual se le va a acer split.
Parametro de entrada: char separator: Es el caracter que separa los bloques de datos.
Parametro de entrada: int index: Para indicar cual es el bloque de datos.
Parametro de salida: String dataSeparada: Se obtiene el bloque de datos en formato String
*/
String getValue(String data, char separator, int index) {
# Metodo para convertir un String a char* en arduino
```
char* string2char(String command) {
if (command.length() != 0) {
char *p = const_cast<char*>(command.c_str());
return p;
}
}
```

To Install .deb files:

sudo dpkg -i filename.deb
sudo apt-get install -f
sudo dpkg -i filename.deb
Another approach to install .deb files is to use gdebi

To Remove:

I have installed Unity in Ubuntu 16 . When I open for 1st time and sign in. I get this message "Service not available. Try again later"

For others with this issue: First, check if you have "libc6" installed (sudo apt install libc6). Secondly, run: sudo locate libresolv This will print a list to where the file is on your disk. For me, I had like three libresolv.so.2 but in different folders. Then, I ran the command written above and it worked. After signing in to Unity I can just start the program without having to use the above command again.

So for me: LD_PRELOAD=/lib/x86_64-linux-gnu/libresolv.so.2 /opt/Unity/Editor/Unity (Execute this command in terminal)

static const uint8_t D0 = 16; static const uint8_t D1 = 5; static const uint8_t D2 = 4; static const uint8_t D3 = 0; static const uint8_t D4 = 2; static const uint8_t D5 = 14; static const uint8_t D6 = 12; static const uint8_t D7 = 13; static const uint8_t D8 = 15; static const uint8_t D9 = 3;

You can do this with sudo usermod -a -G dialout terrik if terrik is your username.