Skip to content

Instantly share code, notes, and snippets.

@sycomix
sycomix / node-and-npm-in-30-seconds.sh
Last active December 19, 2018 11:18 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
#!/bin/bash
sudo apt-get install `grep Remove /var/log/apt/history.log | tail -1 | sed -e 's|Remove: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` >> restore
@sycomix
sycomix / zram.sh
Created May 3, 2018 12:20 — forked from sultanqasim/zram.sh
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@sycomix
sycomix / ufckpip.sh
Last active May 15, 2019 22:05
unf**k pip
pip install --upgrade pip && pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U && pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
find . -type f -exec cat {} +
# Read MAN PAGES, use switches, run bulk commands with this style format. Saves time and/or pisses off compsci teachers LOL
# eg. find . -name Makefile && make && make install {} +
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: S
# Default-Stop: 0 1 6
# Short-Description: Use compressed RAM as in-memory swap
# Description: Use compressed RAM as in-memory swap
### END INIT INFO
@sycomix
sycomix / gist:62425fe53399224f95e8e23478c20b7d
Created June 30, 2018 16:32
PI3b/b+config from hell (use fan and heatsync, failure to do so or to even try this dumb shit is on you)
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
#include "ipp.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
const IppLibraryVersion *lib;
IppStatus status;
Ipp64u mask, emask;
/* Initialize Intel IPP library */
ippInit();
find /etc /usr /bin -exec stat --format "chmod %a ${MPOINT}%n" {} \; > /tmp/restoreperms.sh
apt-get install -y automake autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev make g++ git libgmp-dev
git clone https://github.com/magi-project/m-cpuminer-v2
cd m-cpuminer-v2
./autogen.sh
CFLAG="-O2 mfpu=neon-vfpv4" ./configure
make
cd m-cpuminer-v2