Thanks to visit codestin.com
Credit goes to gist.github.com

Skip to content

Instantly share code, notes, and snippets.

View Chasbob's full-sized avatar

Charles de Freitas Chasbob

View GitHub Profile
import requests
url = 'https://onlinetimetables.bham.ac.uk/timetable/current_academic_year/default.aspx'
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36",}
s = requests.session()
r = s.get(url)
from bs4 import BeautifulSoup
@Chasbob
Chasbob / canvas.py
Created May 4, 2019 10:59
canvas file downloader
import json
import os
import requests
url = "https://canvas.bham.ac.uk/api/v1/"
token = "<Get a token from canvas on your profile under settings>"
# 31163 is the id of Models of Computation
# you can see a course id in the url when you open it on canvas
myResponse = requests.get(url + "courses/31163/modules/?access_token=" + token)
#!/bin/bash
git clone --bare https://github.com/Chasbob/dotfiles.git $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}
config checkout
config config --local status.showUntrackedFiles no
@Chasbob
Chasbob / pom.xml
Created December 2, 2018 14:08
party planner
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<src.dir>src/main/java</src.dir>
@Chasbob
Chasbob / Installation.md
Created October 26, 2018 12:08 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
# some ls aliases
alias ls='ls -G'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
#some grep aliases
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
@Chasbob
Chasbob / rclone.service
Last active July 10, 2018 14:49
plex rclone mount
[Unit]
Description=Mount and cache Google drive to /home/charlie/plex
After=syslog.target local-fs.target network.target
[Service]
Environment=RCLONEHOME=/home/charlie/.config/rclone
Environment=MOUNTTO=/home/charlie/plex
Environment=LOGS=/home/charlie/plex_logs
Environment=UPLOADS=/home/charlie/plex_uploads
Type=simple
User=root
@Chasbob
Chasbob / docker-compose.yml
Last active July 10, 2018 14:48
docker compose for plex setup
version: '3'
services:
plex:
image: linuxserver/plex
container_name: plex
volumes:
- /home/charlie/configs/plex/config:/config
- /home/charlie/plex/Movies:/data/movies
- /home/charlie/plex/TV:/data/tvshows
- /home/charlie/configs/plex/transcode:/data/transcode