This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='\[\033[01;32m\]└──[\[\033[00m\]\[\033[01;31m\]\w\[\033[00m\]\[\033[01;32m\]]──[\[\033[00m\]\[\033[01;34m\]ѱ \[\033[00m\]$(gitp)\[\033[01;32m\]]──[\[\033[00m\]$(gits)\[\033[01;32m\]]\[\033[00m\]\n \[\033[01;32m\]└──>\[\033[00m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char* argv[]){ | |
printf("Hello World\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export http_proxy="http://127.0.0.1:9999" | |
export https_proxy="http://127.0.0.1:9999" | |
export GOPATH=$HOME/gospace | |
export GOROOT=/usr/local/go | |
export PATH=$PATH:$HOME/.local/bin:$GOPATH/bin:$HOME/bin:$GOROOT/bin:$HOME/.cargo/bin | |
export RUST_SRC_PATH=$HOME/.cargo/src/rustc-1.11.0/src | |
RED="\[$(tput setaf 9)\]" | |
GREEN="\[$(tput setaf 12)\]" | |
RESET="\[$(tput sgr0)\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -e "/tmp/emacs1000/server" ]; then | |
if [ $# == 0 ]; then | |
emacsclient -n -e "(other-frame 0)" | |
else | |
emacsclient -n $@ | |
fi | |
else | |
/usr/bin/emacs $@ & | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
progyinstaller() | |
{ | |
if [ "$(id -u)" == "0" ]; then | |
echo "Please don't run this script as root" | |
exit | |
fi | |
echo "Installing proGY..." | |
echo "Installing Binary from github releases" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl "https://archive.org/details/126BuddiesThickerThanWater1962" > /tmp/tmp-0932902.html | |
cat /tmp/tmp-0932902.html | grep -o "download-pill\"\ href=\".*\.mp4\">" | sed "s/download-pill\"\ href=\"/axel\ -n\ 20\ \"https:\/\/archive.org/g" | sed "s/\">$/\"/g" > /tmp/tjdwnscr | |
sh /tmp/tjdwnscr |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── abi | |
│ └── cpp | |
│ ├── include | |
│ └── src | |
├── bionic | |
│ ├── benchmarks | |
│ ├── libc | |
│ │ ├── arch-arm | |
│ │ │ ├── bionic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We need a URL to be downloaded. | |
if len(os.Args) < 2 { | |
fmt.Println("One more commandline argument needed. (url)") | |
return | |
} | |
// assign it to a variable. | |
url := os.Args[1] | |
// I'm not checking the URL passed for validity or url query parameters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total := head.ContentLength | |
// Say I want to make 50 connections. | |
// bpc is bytes per connection | |
bpc := total / 50 | |
// Get the filename.... | |
outfile := path.Base(url) | |
// Create a directory for our temp sections. | |
err = os.Mkdir(filepath.Join("/tmp/", outfile), 0755) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loop and make 50 go routines or cncurrent function calls.... | |
for count < 50 { | |
// Size (in no. of bytes) that has to be requested from the server | |
size := int64(bpc) | |
// If all that left is less than itself download the rest | |
// This generally happens in the last connection.... | |
if total-size < size { | |
size = total | |
} |
OlderNewer