Skip to content

Instantly share code, notes, and snippets.

View CodeAsm's full-sized avatar
🌏
Doing my coding thingies

CodeAsm CodeAsm

🌏
Doing my coding thingies
View GitHub Profile
@tayfie
tayfie / 4chan-wget-scraping.md
Created March 14, 2017 04:36
how to scrape images from 4chan using wget

How To Scrape Images from 4chan Using Wget

This guide is to save other sorry plebs from needing to RTFM in figuring out how to use wget to scrape images from 4chan and other imageboards. There are lots of image downloaders in existence, but they are usually outdated and broken. You will save time following this guide to learn how to use a powerful and general purpose tool instead.

What Is Wget?

Wget is a command-line file downloader that can handle just about any file downloading task normal and power users will ever need to do. It has versions available for Windows, Mac, and Linux. If it is not already installed on your machine, install it now.

Basic syntax

@plainspooky
plainspooky / MEMDUMP.BAS
Created January 20, 2016 14:36
Just trying my skills in MSX-BASIC :-)
10 SA!=&H7DAD:EA!=&H7FFF:COLOR 15,4,4:KEY OFF:SCREEN 0:IF PEEK(&H2D)=0 THEN W%=40:GOTO 20 ELSE PRINT "Display in [4]0 or [8]0 columns?"
15 K$=INPUT$(1):IF K$="4" THEN W%=40 ELSE IF K$="8" THEN W%=80 ELSE 15
20 WIDTH W%:CLS:C%=0:I%=0:J%=0:K%=0
25 IF W%=80 THEN MX%=16:CH%=7:CA%=58:CC%=78 ELSE MX%=8:CH%=5:CA%=29:CC%=38
30 DEF FN H$(I%)=RIGHT$("0"+HEX$(I%),2):DEF FN W$(I!)=RIGHT$("000"+HEX$(I!),4)
40 FOR I!=SA! TO EA!:J%=PEEK(I!):C%=C% XOR J%:IF K%=0 THEN LOCATE 0:PRINT FN W$(I!);
45 LOCATE 3*K%+CH%:PRINT FN H$(J%);" ";
50 LOCATE K%+CA%:IF J%<32 THEN PRINT "."; ELSE PRINT CHR$(J%);
55 K%=K%+1:IF K%=MX% THEN LOCATE CC%:PRINT FN H$(C%);:K%=0
60 IF CSRLIN>22 THEN PRINT "Scroll?";:K$=INPUT$(1):CLS
@emarsk
emarsk / xorg_depgraph.dot
Last active March 8, 2021 11:28
Xorg graphviz dependency graph, as in BLFS book. To generate the image: "dot -Tpng xorg_depgraph.dot >xorg_depgraph.png".
// Xorg dependency graph (dot)
// BLFS 7.8
//
// style=solid : required
// style=dashed : recommended
// style=dotted : optional
// style=solid arrowhead=dot color=grey : required at runtime
strict digraph xorg {
label="Xorg dependencies
@TutorialDoctor
TutorialDoctor / fuzzypy.py
Created September 1, 2015 19:34
A Fuzzy Logic Experiment with Python
# Fuzzy Logic experiment (WIP)
# By the Tutorial Doctor
# Objects are not always in one of two states (true or false), but rather in several states at one time.
#(val-min)/(max-min)
#---------------------------------------------------------------------------
#VARIABLES
#------------------------------------------------------------------------------
cold =(1,213)
@fboris
fboris / stm_native_bootloader.md
Last active April 1, 2025 10:40
dfu-util command for uploading firmware on ST devices
  1. Let device to enter dfu-mode. And use dfu-util to get available devices

sudo dfu-util -l

It will show like...

Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 g,01*016 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=1, name="@Option Bytes  /0x1FFFC000/01*016 g", serial="3262355B3231"
@preshing
preshing / build_cross_gcc
Last active March 20, 2025 12:45
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@trixpan
trixpan / How-to Arch Linux on Cubieboard 1.md
Last active July 21, 2021 17:10
How to really Arch Linux on Cubieboard 1.... (for the Wiki entry is sort of short of some things)

Intro Notes

I wrote this guide because after getting my CubieBoard 1 I followed the Arch Linux ARM instructions and was suprised to be left with a system that albeit working, had missing RAM and no fbconsole at all.

This guide gets Arch Linux ARM into your 1GB Cubieboard 1 with the minimum functionality one would expect. It is not intended to be an all encompassing document, focusing instead on saving your time having to read through the forum to get functionality that otherwise every other Linux distribution brings out of box.

You will have to adjust these instructions if you have a 512M Cubieboard.

Step 1 - Format disk your SD Card

At a minimum, you need to create the first partition on an SD card to store the bootloader files and kernel uImage. For the root filesystem you can choose to use either a second partition on the SD card, USB or SATA. This guide however only covers SD. Replace instances of /dev/mmcblkX with the appropriate device name registered on your system.

@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@xumingyong
xumingyong / gist:1756987
Created February 7, 2012 03:34
Build Libev with MinGW

Steps

  1. Download libev source in http://dist.schmorp.de/libev/
  2. run >sh ./configure
  3. run >make
  4. libev.a static lib file generated in ./lib

Notes:

I remembered that I cannot compile it successfully before. But after I compiled the LibUV, and added the header file & libs, I can build libev successfully.

@zdxerr
zdxerr / glUtils.js
Created October 4, 2011 10:16
Small webgl example
// augment Sylvester some
Matrix.Translation = function (v)
{
if (v.elements.length == 2) {
var r = Matrix.I(3);
r.elements[2][0] = v.elements[0];
r.elements[2][1] = v.elements[1];
return r;
}