Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Cyrus Frost cyfrost

👨‍💻
View GitHub Profile
@maxivak
maxivak / __upload_file.md
Last active Sep 15, 2021
PHP upload file with curl (multipart/form-data)
View __upload_file.md

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active Sep 20, 2021
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
View postman-deb.sh
#!/bin/sh
ls Postman*.tar.gz > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
fi
curlExists=$(command -v curl)
@iosecure
iosecure / iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment.md
Last active Aug 28, 2021
iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment
View iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment.md

iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

This post by a security researcher who prefers to remain anonymous will elucidate concerns about certain problematic decisions Apple has made and caution about future decisions made in the name of “security” while potentially hiding questionable motives. The content of this article represents only the opinion of the researcher. The researcher apologises if any content is seen to be inaccurate, and is open to comments or questions through PGP-encrypted mail.



TL;DR

@NikitaKarnauhov
NikitaKarnauhov / tlrecode.sh
Created May 16, 2016
Shell script to decode and encode TP-LINK router config files
View tlrecode.sh
#!/usr/bin/env bash
# tlrecode.sh
# Decode and encode TP-LINK router config files.
#
# Creative Commons CC0 License:
# http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0 with this
# work has waived all copyright and related or neighboring rights to this work.
@ankurk91
ankurk91 / install_lamp_ubuntu.sh
Last active Sep 6, 2021
Ubuntu 20 - PHP development (php 7.4/8, apache 2.4)
View install_lamp_ubuntu.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 20.04 dev Server
# Run like (without sudo) - bash install_lamp.sh
# Script should auto terminate on errors
export DEBIAN_FRONTEND=noninteractive
View gist:3b19447b304616f18657
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@rasschaert
rasschaert / arch_bootstrap.bash
Last active Jun 19, 2021
Shell script that performs the installation of Arch Linux the way I like it.
View arch_bootstrap.bash
#!/bin/bash
bootstrapper_dialog() {
DIALOG_RESULT=$(dialog --clear --stdout --backtitle "Arch bootstrapper" --no-shadow "$@" 2>/dev/null)
}
#################
#### Welcome ####
#################
bootstrapper_dialog --title "Welcome" --msgbox "Welcome to Kenny's Arch Linux bootstrapper.\n" 6 60
@abatkin
abatkin / basic-system.md
Last active Mar 23, 2019
Make Gnome 3.0 Usable (Fedora 20)
View basic-system.md

Basic System

This set of documents explains how I make a "usable" developer system using Fedora under various desktop environments. This was all tested with Fedora 20.

  • Update all packages
  • Fix dumb GTK+ 3 Scrollbar behavior:
# http://askubuntu.com/questions/295988/how-to-fix-gtk3-scrollbar-behavior
# https://bugzilla.gnome.org/show_bug.cgi?id=683885
# Add to .config/gtk-3.0/settings.ini:
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tsabat
tsabat / zsh.md
Last active Aug 1, 2021
Getting oh-my-zsh to work in Ubuntu
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh