Giter Site home page Giter Site logo

fish404 / code_snippet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yeasy/code_snippet

0.0 1.0 0.0 211 KB

Some simple but useful source codes, scripts or templates, on networking, programming, algorithm, etc.

Python 30.00% C 40.70% Vim Script 2.95% Makefile 3.01% Shell 21.09% HTML 1.73% JavaScript 0.52%

code_snippet's Introduction

Code Snippet

Some simple but useful source codes, scripts or templates, on networking, programming, algorithm, etc.

Most of them are written by me, while some one may be collected from Internet or modified based or public-available codes.

All files are free to use, distribute or modify, with keeping the declare part on the file head. However, the authors WILL NOT be responsible for any result by these files. If you think there might be some one affecting your privilege, please let me know.

autopreview

A light script plugin for Vim that could automatically preview the definition of variables or functions in a tiny window like source insight. Also be hosted at the vim homepage.

algorithm

Some code blocks for test algorithms, such as sorting, searching, etc..

bf-gdt

Example to show how to use the bloom-filter based gdt data structure.

cpu

Get overall cpu utilization at linux platform.

Docker

Some docker related scripts and tools.

docker_cleanup

Do some cleanup work on Docker Host, e.g., removing stopped containers and untagged images.

ovs_perf

Test two containers connecting through OpenvSwitch with iperf

save_all_images

Save all local Docker images into tar.gz files.

restore_images

This script will load into the tar.gz files as images.

ether_bridge

Connect to network interface and forward ethernet packets between them bidirectionally, supporting options.

getIP

Some scripts to get local ip address of the network interfaces.

getopt

Show how to use getopt functions.

io

Test read and write functions.

json

Example to show how to use json encoding/decoding in python.

mcast

Test the multi-cast packet sending and receiving, using a thread separately.

Makefile.template

Simple template of Makefile.

netlink

Test bidirectional communication between userspace and kernelspace, using low-level netlink APIs in the userspace, and libnl APIs in the kernelspace.

Use openssl to generate certificate and serve a website with TLS.

Simple codes to show how to use python libraries, e.g., regrex, encoding.

amqp

Demo the usage of AMQP by the kombu and pika.

concurrency

Some scripts on concurrency programming, such as threading, eventlet...

gitbook_gen

Generate an initialized gitbook project based on the given source code path.

httpserver

A simple webserver by python, which tracks request number of each visitor's IP address.

mqtt

Demo the usage of MQTT.

prefixCutter

Calculate the cut prefixes by given two prefixes.

remote_watcher

Watch the specified file on remote, trigger action when there finds keyword in it.

sm_watcher

Track (and filter) the board articles on the given url (newsmth now), and show them in a webpage in realtime (using jquery and HTML5 websocket).

ss_watcher

Auto fetch proxy information and update local config.

wsgi

A demo to show how to use wsgi and paste deployment to provide a web service. Run python server.py and get the version information by visiting localhost:8080.

remoteAuth.sh

An ssh authorized script, which enables you to login into remote host automatically without passwd inputing.

pull_agent.sh

Daemon agent to pull some content from remote host, and do action after check changes.

push_agent.sh

Daemon agent to push some msg to remote host file.

Example to show how to construct a raw socket packet, with manually setting the mac, ip and udp header.

shell

Useful shell scripts.

Some system related tools, such as init a fresh os.

getweb.sh

Simple but powerful script, which can automatically download a website by URL and save it to local directory for offline reference.

rm.sh

A much safer rm script, which can automatically backup removed files, in case deleting useful data (beta version).

nss

This script will show all ip address inside each network namespace. If give a parameter, then it will show the network namespace containing the key. This is useful for openstack debugging.

service

Example of a system service script in Debian/Ubuntu system, supporting running complicated command with arbitrary parameters.

sysctl.conf

Optimized configuration for /etc/sysctl.conf.

limits.conf

Optimized configuration for /etc/security/limits.conf.

code_snippet's People

Contributors

yeasy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.