Skip to content

Instantly share code, notes, and snippets.

View akkuman's full-sized avatar
💭
I may be slow to respond.

akkuman

💭
I may be slow to respond.
View GitHub Profile
@Jekis
Jekis / toggle_swap.sh
Last active August 17, 2024 01:06
Empty swap. Clear swap. Move swap to RAM. Ubuntu.
#!/bin/bash
function echo_mem_stat () {
mem_total="$(free | grep 'Mem:' | awk '{print $2}')"
free_mem="$(free | grep 'Mem:' | awk '{print $7}')"
mem_percentage=$(($free_mem * 100 / $mem_total))
swap_total="$(free | grep 'Swap:' | awk '{print $2}')"
used_swap="$(free | grep 'Swap:' | awk '{print $3}')"
swap_percentage=$(($used_swap * 100 / $swap_total))
@flankerhqd
flankerhqd / JEB2AutoRenameByTypeInfo.py
Created September 18, 2017 07:21
JEB2 renaming script
# -*- coding: utf-8 -*-
"""
Sample client script for PNF Software's JEB2.
More samples are available on our website and within the scripts/ folder.
Refer to SCRIPTS.TXT for more information.
"""
@curi0usJack
curi0usJack / .htaccess
Last active September 23, 2025 22:00
FYI THIS IS NO LONGER AN .HTACCESS FILE. SEE COMMENTS BELOW. DON'T WORRY, IT'S STILL EASY.
#
# TO-DO: set |DESTINATIONURL| below to be whatever you want e.g. www.google.com. Do not include "http(s)://" as a prefix. All matching requests will be sent to that url. Thanks @Meatballs__!
#
# Note this version requires Apache 2.4+
#
# Save this file into something like /etc/apache2/redirect.rules.
# Then in your site's apache conf file (in /etc/apache2/sites-avaiable/), put this statement somewhere near the bottom
#
# Include /etc/apache2/redirect.rules
#
@mortenson
mortenson / composelist.sh
Last active March 21, 2025 05:46
List all Docker Compose projects currently running
#!/bin/bash
docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| sort | uniq
@WincerChan
WincerChan / get_link.py
Last active October 22, 2021 05:53
获得QQ音乐直链
@yimeng
yimeng / gist:bdc7b14d5482042667cf1f06571b3966
Created January 30, 2018 08:26 — forked from lajunta/gist:8214228
自由软件中国镜像站点汇总
阿里云镜像:http://mirrors.aliyun.com/
网易开源镜像站:http://mirrors.163.com/
搜狐开源镜像站:http://mirrors.sohu.com/
北京交通大学开源镜像站:http://mirror.bjtu.edu.cn
兰州大学开源软件镜像站:http://mirror.lzu.edu.cn/
厦门大学开源软件镜像站:http://mirrors.xmu.edu.cn/
上海交通大学开源软件镜像站:http://ftp.sjtu.edu.cn/
清华大学开源软件镜像站:http://mirrors.tuna.tsinghua.edu.cn/
天津大学开源软件镜像站:http://mirror.tju.edu.cn/
中国科学技术大学开源软件镜像站:http://mirrors.ustc.edu.cn/
@steven2358
steven2358 / ffmpeg.md
Last active October 27, 2025 18:19
FFmpeg cheat sheet
@tegansnyder
tegansnyder / Preventing-Puppeteer-Detection.md
Created February 23, 2018 02:41
Preventing Puppeteer Detection

I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:

Set my args as follows:

const run = (async () => {

    const args = [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-infobars',
@ashishtiwari1993
ashishtiwari1993 / es_exception_challenges.md
Last active March 26, 2021 01:22
Below are some challenges & exceptions faced while setting up Elasticsearch. I just shared my experience and learning. Please correct me, If you guys feel somewhere i got wrong OR You can contribute if you have any experiences . Will keep update this gist.

(by @_ashish_tiwari)


Elasticsearch specification:

Version : 6.2
Heap size : 30 GB
core : 24
Memory : 128 GB
Client : PHP - 6.0

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.