Skip to content

Instantly share code, notes, and snippets.

View izinin's full-sized avatar

Igor Zinin izinin

View GitHub Profile
@izinin
izinin / ANSI.md
Created January 11, 2023 20:27 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@izinin
izinin / socket_examples.erl
Created October 2, 2022 10:14 — forked from xiaohanyu/socket_examples.erl
Socket programming examples in erlang.
%% socket examples from Joe Armstrong's "Programming Erlang, Second Edition".
-module(socket_examples).
-compile(export_all).
-import(lists, [reverse/1]).
string2value(Str) ->
{ok, Tokens, _} = erl_scan:string(Str ++ "."),
{ok, Exprs} = erl_parse:parse_exprs(Tokens),
Bindings = erl_eval:new_bindings(),
{value, Value, _} = erl_eval:exprs(Exprs, Bindings),
@izinin
izinin / ping.py
Created September 28, 2022 19:41 — forked from pklaus/ping.py
A pure python ping implementation using raw socket.
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@izinin
izinin / options.erl
Created September 22, 2022 18:58 — forked from bluegraybox/options.erl
Erlang command-line option handling
#!/usr/bin/escript
-module(options).
% main/1 calls main/3 with default values
main(Args) -> main(false, "", Args).
main(_, _, ["-h" | _ ] ) -> io:format("Help text...~n"); % help
main(_, Value, ["-f" | Args ] ) -> main(true, Value, Args); % set flag
main(Flag, _, ["-v", Value | Args ] ) -> main(Flag, Value, Args); % set value
@izinin
izinin / InstallingSwift.md
Created May 15, 2022 13:25 — forked from Jswizzy/InstallingSwift.md
Swift Install Instruction 20.04

Installing Swift on Ubuntu 20.04

1. Install Depencies

“clang”[ˈklæŋ] is the compiler based on LLVM for C, C++, Objective-C, and Objective-C++. clang is needed to install in order to Swift. Run the following code in Ubuntu terminal.

Before installing swift “libpython2.7” and “libpython2.7-dev” are needed to get Swift running. Run the following code.

@izinin
izinin / HelloJNI.java
Created May 14, 2022 16:35 — forked from LongClipeus/HelloJNI.java
Example JNI/C++ Hello World in Ubuntu
public class HelloJNI {
static {
System.loadLibrary("hello"); // load libhello.so
}
private native void sayHello();
public static void main(String[] args) {
new HelloJNI().sayHello();
}
@izinin
izinin / main.ts
Last active December 23, 2020 19:03 — forked from tablekat/main.ts
Making gmail push notifications to webhook
import * as request from 'request';
import * as fs from 'fs';
import * as readline from 'readline';
var google = require('googleapis');
var googleAuth = require('google-auth-library');
/*************** STEPS
- made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing?
@izinin
izinin / application.properties
Created August 22, 2020 18:52 — forked from DengYiping/application.properties
Spring Application Properties for MariaDB
#Database Configuration
spring.datasource.url=jdbc:mariadb://localhost:3306/billboard
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
#Hibernate Configuration
# Show or not log for each sql query
spring.jpa.show-sql=true
@izinin
izinin / Useful netcat examples on Linux.md
Created August 14, 2020 13:33 — forked from lenciel/Useful netcat examples on Linux.md
Useful netcat examples on Linux

Often referred to as the "swiss army of knife" for TCP/IP networking, [Netcat][1] is an extremely versatile Linux utility that allows you to do anything under the sun using TCP/UDP sockets. It is one of the most favorite tools for system admins when they need to do networking related troubleshooting and experimentation.

In this tutorial, I am sharing a few useful netcat examples, although the sky is the limit when it comes to possible netcat use cases. If you are using netcat regularly, feel free to share your use case.

Note that when you are binding to well-known ports (0-1023) with nc, you need root privilege. Otherwise, run nc as a normal user.

1. Test if a particular TCP port of a remote host is open.

$ nc -vn 192.168.233.208 5000
@izinin
izinin / ndk_basics.md
Created December 30, 2018 14:14 — forked from okamayana/ndk_basics.md
Android Studio: Writing and calling JNI functions

Purpose

Writing JNI functions

  1. Create a new Android Studio project. To do so, select File -> New -> New Project.