Skip to content

Instantly share code, notes, and snippets.

@echo off
SET /A CONN=0
:Start
pause
SET /A CONN+=1
@ECHO --------START Connection %CONN%--------
Echo.
ping -n 10 www.google.com
ECHO ---------END Connection %CONN%----------
Echo.
@lamegaton
lamegaton / Ping_for_linux.sh
Last active July 1, 2021 22:55
Ping manually on linux
#!/bin/bash
running=true
for ((i=1; i <= 100; i++ )); do
if [[ "$running" == "true" ]]; then
printf ">>>>>>>>>>>>>> $i Iteration <<<<<<<<<<<<<<\n"
ping -c 10 www.google.com -A
fi
read -sn 1
@lamegaton
lamegaton / Perl_for_speed.md
Last active March 24, 2021 22:17
Learning Perl

Hi everyone, today I decide to learn Perl because its quick text processing capability.
I like to solve practical problem so here I'll show you how I solve each problem using Perl.
*Strawberry Perl 5 (windows) is used for this tutorial.

1: How to convert from 1 column to multiple column

So in this problem, I have a column with alternative value such as

Elephan
10
Shark

@lamegaton
lamegaton / example-of-getelements.markdown
Created September 24, 2020 20:37
Example of getElements
<?php
$requestBody = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(array(
'requests' => array(
'deleteDimension' => array(
'range' => array(
'sheetId' => 0,
'dimension' => "ROWS",
'startIndex' => $rowtodelete, // row number to delete
'endIndex' => $rowtodelete + 1
)
@lamegaton
lamegaton / AdbCommands
Last active April 23, 2024 16:37 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@lamegaton
lamegaton / allInOneADBCommands.md
Last active August 4, 2020 17:54
All useful adb commands

Common adb commands

Check cpu info

adb shell cat /proc/cpuinfo

Run an app via adb

Open cmd:

adb root
adb shell

Find that app (in Android linux terminal):

@lamegaton
lamegaton / LEDs_wESP12E_wESP8266WebServer.ino
Last active November 21, 2018 21:43
Code to control 8x8 LED Matrix using AP mode on ESP8266
///********************************************************/
// credits to https://github.com/MajicDesigns/MD_MAX72XX
// Son Pham 10-17-2018
// Project: Signal Board for Bikers
/********************************************************/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <MD_MAX72xx.h>
@lamegaton
lamegaton / esp_max_LED.ino
Created October 17, 2018 22:50
use ESP8266 + Max7219 LED matrix, the speed is very slow, need to be improved
// credits to https://github.com/MajicDesigns/MD_MAX72XX
#include <ESP8266WiFi.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
//Declare hardware
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN 14 // or SCK
@lamegaton
lamegaton / timeLeft.py
Created September 14, 2018 08:02
Calculate and print out time left on earth
import time
from datetime import date
#def count_time_left():
today =date.today()
while True:
yourMonth = int(input("Enter your Month of birth MM: "))
if yourMonth >12 or yourMonth < 0:
print('please try MM again!')