Skip to content

Instantly share code, notes, and snippets.

View ly0's full-sized avatar
👊
已全仓买入

latyas ly0

👊
已全仓买入
View GitHub Profile
@MichaelCurrin
MichaelCurrin / self-extracting-shell-scripts.md
Last active October 19, 2023 06:07
Self-extracting shell scripts

Self-extracting shell scripts

Guide to using MakeSelf tool to create self-extracting shell scripts for easy distribution

How to package your shell scripts project as a release which can be easily downloaded, extracted, and run.

This is intended to work with one or more executable scripts that use a shell shebang. This could work with other shebangs I guss, but you're probably better off using the packaging approach for that language.

This guide is written for macOS / Linux.

@ohanetz
ohanetz / Dockerfile-jenkins
Last active October 1, 2022 09:03
Utilize Jenkins in an auto-scaling Kubernetes deployment on Amazon EKS
FROM jenkins/jenkins:2.204.5
RUN /usr/local/bin/install-plugins.sh ssh-slaves
RUN /usr/local/bin/install-plugins.sh kubernetes
USER root
RUN apt-get update && apt-get install -y maven
USER jenkins
@rocka
rocka / bbr.sh
Last active August 22, 2017 06:58
enable bbr in OpenVZ VPS
#!/bin/bash
fuser -k /dev/net/tun
# delete tap0
ip tuntap del dev tap0 mode tap
# add tap0
ip tuntap add dev tap0 mode tap
ip link set dev tap0 up
ip addr add dev tap0 10.0.0.1/24
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active July 16, 2024 08:48
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@danibram
danibram / iptables.sh
Created February 3, 2016 12:03
Redirect 443,80 to 8443,8080 on ubuntu with persistence
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
sudo sh -c "iptables-save > /etc/iptables.rules"
sudo apt-get install iptables-persistent
@imrickysu
imrickysu / xapp1078_2014.4.markdown
Last active July 13, 2018 11:16
The instructions of creating an AMP example design with PetaLinux tools

Xapp1078 Instructions for Vivado 2014.4

NOTE: The zedBoard flow has not been verified

Note: This xapp requires using a Linux host to compile the embedded Linux kernel. The instructions have been setup such that all implementation work will be done in a directory called xapp1078_2014.4/design and all linux work will be done in a directory called xapp1078_2014.4/plnx-project. The instructions will require files to be copied between xapp1078_2014.4/design and xapp1078_2014.4/plnx-project so if the Vivado and SDK tools are ran on a Windows machine, the files will need to be copied from the Windows xapp1078_2014.4/design to the Linux machine's xapp1078_2014.4/plnx-project.

@socantre
socantre / CMakeLists.txt
Created August 24, 2015 03:45
Example of using add_custom_command and add_custom_target together in CMake to handle custom build steps with minimal rebuilding: This example untars library headers for an INTERFACE library target
set(LIBFOO_TAR_HEADERS
"${CMAKE_CURRENT_BINARY_DIR}/include/foo/foo.h"
"${CMAKE_CURRENT_BINARY_DIR}/include/foo/foo_utils.h"
)
add_custom_command(OUTPUT ${LIBFOO_TAR_HEADERS}
COMMAND ${CMAKE_COMMAND} -E tar xzf "${CMAKE_CURRENT_SOURCE_DIR}/libfoo/foo.tar"
COMMAND ${CMAKE_COMMAND} -E touch ${LIBFOO_TAR_HEADERS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/foo"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libfoo/foo.tar"
@iansinnott
iansinnott / docker_wrapper.sh
Last active March 20, 2016 12:29
Automatically set up boot2docker on a Mac whenever `docker` is called
#!/bin/bash
# A wrapper for the docker binary. Checks to make sure the docker host is
# set before executing docker commands.
docker() {
# Start the daemon if it's not running
if [ $(boot2docker status) != 'running' ]; then
echo 'Starting the Docker daemon.'
boot2docker start
@mikkeloscar
mikkeloscar / guide.md
Created June 14, 2014 20:44
Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Simple way to setup an arm chroot for building packages for your arm devices. This is an alternative to cross-compiling where you are limited to only linking against the libs in your toolchain.

Setup chroot-fs

You can store the chroot wherever you like. I choose to store it in a disk-image which I mount to my filesystem.

@arjunnambiartc
arjunnambiartc / adminx.py
Last active October 20, 2015 05:37
adminx.py for jericho
import xadmin
from xadmin import views
from models import Sheet1, Change, MyChange
from xadmin.layout import *
class BaseSetting(object):
enable_themes = False
use_bootswatch = False
show_bookmarks = False