This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import crc16 | |
array_z = [] | |
data_one = "4040" | |
data_two = "2900" | |
# convert to byte | |
# print( list(data_one.encode()) ) | |
# print( list(data_two.encode()) ) | |
array_z.append( list(data_one.encode()) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://mntolia.com/mqtt-python-with-paho-mqtt-client/ | |
# source: http://www.steves-internet-guide.com/into-mqtt-python-client/ | |
import paho.mqtt.client as mqtt | |
broker_host = "iot.eclipse.org" | |
broker_port = 1883 | |
def on_connect(client, userdata, flags, rc): | |
print("Connected with result code: "+str(rc)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoJson.h> | |
void setup() { | |
// Initialize Serial port | |
Serial.begin(9600); | |
while (!Serial) continue; | |
// Allocate the JSON document | |
// | |
// Inside the brackets, 200 is the RAM allocated to this document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Noob Web Deploy | |
# Made by @Tester2009 | |
# February 26, 2019 | |
# backup first from VPS backup_public | |
echo "Start backup remote to local" | |
rsync -ravz --relative --progress -e 'ssh -i /Users/tester2009/.ssh/tester2009.pem' ubuntu@some.weird.ip:/home/ubuntu/backup_public/ /Volumes/Backups/26Feb2019 | |
echo "Done backup from /home/ubuntu/backup_public/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# explanation: https://www.youtube.com/watch?v=IcK2Qyk3cUs | |
# written by: github.com/Tester2009 | |
def binary_search(arr, val): | |
if len(arr)==0 or (len(arr)==1 and arr[0]!=val): | |
return False | |
mid = arr[len(arr)/2] | |
if val==mid: | |
print("Found") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# explanation: https://www.youtube.com/watch?v=i-SKeOcBwko | |
# written by github.com/Tester2009 | |
array_1 = [5, 7, 9, 3, 2, 1] | |
for iterate in range( 1, len(array_1) ): # iteration start with 1, because to compare with previous element in array | |
value = array_1[iterate] # assign array_1[value_of_iteration] to value variable | |
element = iterate # assign value_of_iteration to element variable | |
while ( element>0 ) and ( array_1[element-1]>value ): # check if element is more than 0. and check value of previous element in array to compare with current element value | |
array_1[element] = array_1[element-1] # assign value of previous element in array to current array element | |
element = element-1 # assign element to previous element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package bubblesort; | |
import java.util.*; | |
/** | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use this script to copy shared (libs) files to Apache/Lighttpd chrooted | |
# jail server. | |
# ---------------------------------------------------------------------------- | |
# Written by nixCraft <http://www.cyberciti.biz/tips/> | |
# (c) 2006 nixCraft under GNU GPL v2.0+ | |
# + Added ld-linux support | |
# + Added error checking support | |
# ------------------------------------------------------------------------------ | |
# See url for usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Switch> en | |
Switch# conf t | |
Switch(config)# hostname <switch name> | |
S1(config)# no ip domain-lookup | |
S1(config)# vlan 99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Made with <3 by @Tester2009 at July 22, 2018 | |
// https://gist.github.com/Tester2009 | |
// All calculation was made by my friend. If there any mistake in this code, feel free to fix it. | |
// This code is tested on Ubuntu 18.04 LTS x86_64 | |
// g++ car_loan_calculator.cpp -o car_loan_calculator.cpp | |
// ./car_loan_calculator | |
#include <iostream> | |
#include <stdio.h> | |
#include <math.h> |
NewerOlder