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
# This is my configuration with 4K laptop and 1080p monitor in Linux | |
# When 4K laptop is connected with 1080p monitor, the monitor scale is not proportional | |
# The configuration is different when extended monitor is put on the left or right side, so we have to set the panning | |
if [ "$1" == "right" ] | |
then xrandr --output DP-1 --scale 2.0x2.0 --panning 3840x2160+3200+0 --fb 7040x2160 --right-of eDP-1 | |
elif [ "$1" == "left" ] | |
then xrandr --fb 7040x2160 --output eDP-1 --panning 3200x1800+3840+0 --right-of DP-1 --output DP-1 --mode 1920x1080 --scale 2x2 --primary | |
else echo -e "Please choose the position, right or left\nUsage: $0 right|left\n" | |
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
import requests | |
from bs4 import BeautifulSoup | |
from datetime import datetime | |
import json | |
# get page | |
page = requests.get('https://www.worldometers.info/coronavirus/').text | |
# convert to bs | |
bs = BeautifulSoup(page, 'html.parser') |
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
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
sudo usermod -aG docker $USER | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose |
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
// Scraping implementation using channels | |
// go run scrap.go | |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"sync" |
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
#!/usr/bin/env python | |
# only need a few minutes if I calm down | |
# aaarrrgggh | |
string = raw_input() + " " | |
texts = list(string) | |
final_texts = "" | |
x = 0 | |
for num in xrange(len(texts)-1): | |
if texts[num] != texts[num+1]: |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"io/ioutil" | |
"net/http" | |
"encoding/json" | |
"regexp" | |
"strings" |
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
#!/usr/bin/env python | |
import urllib | |
import urllib2 | |
import json | |
import oauth2 as oauth | |
class Lebaran: | |
def __init__(self): | |
# twitter access key |
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
package main | |
import ( | |
"github.com/ChimeraCoder/anaconda" | |
"fmt" | |
"log" | |
"net/url" | |
"strings" | |
"sort" | |
"regexp" |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"io/ioutil" | |
"net/http" | |
"encoding/xml" | |
"sync" | |
"encoding/json" |
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
#!/usr/bin/python | |
# Captcha breaker for ziddu | |
# Need tesseract-ocr installed | |
# Need PIL and pytesser module installed | |
# usage: | |
# $ python ziddu.py ziddu.jpeg | |
# Tesseract Open Source OCR Engine v3.02.02 with Leptonica | |
# captcha: pswx5 |