Skip to content

Instantly share code, notes, and snippets.

View songritk's full-sized avatar

Songrit Kitisriworapan songritk

View GitHub Profile
@songritk
songritk / Config.h
Created July 15, 2023 17:32
Config file for EXOS-2
/* ---------------------------------------------------------------------------------------------------------------------------------
* Configuration for OnStepX
*
* For more information on setting OnStep up see http://www.stellarjourney.com/index.php?r=site/equipment_onstep
* and join the OnStep Groups.io at https://groups.io/g/onstep
*
* *** Read the compiler warnings and errors, they are there to help guard against invalid configurations ***
*
* ---------------------------------------------------------------------------------------------------------------------------------
* ADJUST THE FOLLOWING TO CONFIGURE YOUR CONTROLLER FEATURES ----------------------------------------------------------------------
@songritk
songritk / cut-224.c
Created July 12, 2020 10:41
cut pcap file header
#include<iostream>
#include<fstream>
using namespace std;
int printhex(char c){
if(int(c) < 0) {
printf("%02x",int(c^0xffffff00));
}else{
printf("%02x",int(c));
@songritk
songritk / index.html
Created December 24, 2019 09:46
webssh landing page for Typing speed contest 2020
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>แข่งขันพิมพ์เร็วครั้งที่ 1</title>
<link href="static/img/favicon.png" rel="icon" type="image/png">
@songritk
songritk / tutor-sum.c
Created July 23, 2019 15:52
tutor-sum.c
#include<stdio.h>
int main ()
{
int N=5;
int i=1;
int sum=0;
while( ___ <= ___ ){
sum=sum+___ ;
___++;
@songritk
songritk / tutor-for.c
Created July 23, 2019 15:26
ตัวอย่าง คำสั่ง for
#include<stdio.h>
int main ()
{
int i=0;
for(i=0;i<5;i++) {
printf("Hello\n");
}
return(0);
}
@songritk
songritk / tutor-dowhile.c
Created July 23, 2019 15:08
ตัวอย่าง do while
#include<stdio.h>
int main ()
{
int i=0;
do {
printf("Hello\n");
i++;
}while(i<5);
return(0);
}
@songritk
songritk / tutor-while-1.c
Created July 23, 2019 15:03
tutor-while-1
#include<stdio.h>
int main ()
{
int i=0;
while(i<5) {
printf("Hello\n");
i++;
}
return(0);
}
@songritk
songritk / client.py
Created February 7, 2019 11:51
ตัวอย่าง client เปลี่ยนข้อความตัวอักษรเป็นตัวพิมพ์ใหญ่ สำหรับการเรียนวิชา Computer Networks, NPU Computer Engineer
#!/usr/bin/env python3
from socket import *
serverName='127.0.0.1'
serverPort=12002
clisock=socket(AF_INET,SOCK_DGRAM)
mesg=input('Input lowercase sentence:')
clisock.sendto(mesg.encode(),(serverName, serverPort))
modifiedMessage, serverAddress = clisock.recvfrom(2048)
print(modifiedMessage.decode())
@songritk
songritk / server.py
Last active February 7, 2019 12:01
ตัวอย่าง server เปลี่ยนข้อความตัวอักษรเป็นตัวพิมพ์ใหญ่ สำหรับการเรียนวิชา Computer Networks, NPU Computer Engineer
#!/usr/bin/env python3
from socket import *
serverPort = 12002
serverSocket = socket(AF_INET, SOCK_DGRAM)
serverSocket.bind(('', serverPort))
print ("The server is ready to receive")
while True:
message, clientAddress = serverSocket.recvfrom(2048)
modifiedMessage = message.decode().upper()
serverSocket.sendto(modifiedMessage.encode(), clientAddress)
@songritk
songritk / install-soapysdr.sh
Last active June 27, 2023 07:12
SoapySDR install script for raspberry PI
# Building CubicSDR for Linux
# This script will successfully build CubicSDR under Debian Jessie on the Raspberry Pi3.
# Adapted from https://github.com/cjcliffe/CubicSDR/wiki/Build-Linux
# Larry Dighera June 7, 2016
# [email protected]
# songritk Mar 24,2018
sudo apt-get install -y git build-essential automake cmake
sudo apt-get install -y libpulse-dev libgtk-3-dev