Skip to content

Instantly share code, notes, and snippets.

View chibby0ne's full-sized avatar
🦀

Antonio Gutierrez chibby0ne

🦀
View GitHub Profile
@chibby0ne
chibby0ne / gist:0a7d459a437dfe09b6f32f6a729fda51
Last active February 18, 2018 17:26
How to verify sha256sum without a SHASUMS file on command line

To verify a shasum or any other integrity hash, from a website that hosts a file with its shasum, you would normally take the following approach:

  1. Download the file and its SHASUMS file and place both of these files in the same directory
  2. run sha256sum -c SHASUMS

If the file integrity is intact then it would output:

filename: OK

But what if you only have the file and the shasum and no file? Case in point: Downloading boost libraries from official website

@chibby0ne
chibby0ne / RaspberryPi 3 Retropie OS Wifi using DHCP with DNS and Gateway in different devices
Last active December 2, 2017 21:49
RaspberryPi 3 Retropie OS Wifi using DHCP with DNS and Gateway in different devices
The main three things are these:
1. Inside /etc/network/interfaces:
The wifi interface should be set as dhcp as have the usual settings for using wpa_conf
2. Inside /etc/dhcpcd.conf:
Disable ipv6
Add the the gateway (router) as static routers=...
3. Create a file /etc/sysctl.d/40-ipv6.conf, where you disable ipv6 for all AND for each interface
(more info about ipv6 disabling in https://wiki.archlinux.org/index.php/IPv6#Disable_IPv6)
@chibby0ne
chibby0ne / listdirs.sh
Last active August 29, 2015 14:16
One-liner that lists all the directories in a give path, one line at a time
#!/bin/bash
find -maxdepth 1 -type d -print | grep -v \\.
@chibby0ne
chibby0ne / listhiddenfiles.sh
Created February 28, 2015 01:42
One-liner that lists all the hidden files from a given directory
#!/bin/bash
# Add this one-liner script to the PATH variable and have the power to count the files in a directory from anywhere in the command line
ls -al $1 | grep -E \ \\..*$
@chibby0ne
chibby0ne / fix_first_ten_files.sh
Last active August 29, 2015 14:15
One-liner that adds a 0 to filename's ranging from 1 to 9, when there are more than 9 files with numbers appended in their filename, thus fixing the ordering when listed
#!/bin/bash
# Add this one-liner script to the PATH variable and have the power to count the files in a directory from anywhere in the command line
#NAME is the prefix that the files share in common
NAME=$1; ls -1 | grep -E ${NAME}[0-9]{1}\\. | sed -e 'p;s/\([0-9]\)/0\1/g' | xargs -n 2 mv
@chibby0ne
chibby0ne / filecount.sh
Last active August 29, 2015 14:14
Counts the number of files of a given directory
#!/bin/bash
# Add this one-liner script to the PATH variable and have the power to count the files in a directory from anywhere in the command line
ls -1 $1 | wc -l