Skip to content

Instantly share code, notes, and snippets.

View FrostyX's full-sized avatar

Jakub Kadlčík FrostyX

View GitHub Profile
@FrostyX
FrostyX / FacebookDebugger.php
Last active February 9, 2022 11:15
Facebook API - Force facebook to reload cache from your website
<?php
class FacebookDebugger
{
/*
* https://developers.facebook.com/docs/opengraph/using-objects
*
* Updating Objects
*
* When an action is published, or a Like button pointing to the object clicked,
* Facebook will 'scrape' the HTML page of the object and read the meta tags.
@FrostyX
FrostyX / lsof-deleted.py
Last active August 29, 2015 14:04
Print list of processes with deleted files
#!/usr/bin/python
import psutil
import re
paths = ['/usr/bin', '/usr/sbin', '/usr/lib', '/lib']
combined = "(" + ")|(".join(paths) + ")"
processes = []
for pid in psutil.get_pid_list():
@FrostyX
FrostyX / pysleep.py
Last active August 29, 2015 14:06
Easy-to-use "suspend after some time" program for Windows
#!/usr/bin/python
import time
import subprocess
# s -- hh:mm:ss
def str_to_sec(s):
# http://stackoverflow.com/a/6402859/3285282
l = s.split(':')
@FrostyX
FrostyX / README.md
Last active September 3, 2015 12:55
Python unicode hell

Python unicode hell

Welcome to my personal piece of hell.

This repository is collection of commonly (by me) used snippets which I need to search over and over again, due to compatibility issues between Python2 and Python3. I hope it will make me stop trying killing myself by hitting the wall with my head.

References:

@FrostyX
FrostyX / README.md
Last active June 4, 2016 11:10
Install Windows 7 via USB

Run diskpart and then

Windows:

list disk
select disk <num>
clean
create partition primary
select partition 1

active

#!/usr/bin/env python
import socket
import os
import sys
def listen_for_token():
"""
Listens on port 13747 on localhost for a redirect request by OIDC
server, parses the response and returns the "access_token" value.
"""
@FrostyX
FrostyX / publish-fedmsg.py
Last active April 3, 2017 19:13
Workaround for Copr MBS on dev machine - publish message that build is done (not needed anymore)
import fedmsg
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('build_id', type=int)
parser.add_argument('pkg', type=int, help='See code of this script for possible indexes')
args = parser.parse_args()
pkgs = [None,
@FrostyX
FrostyX / README.md
Last active July 14, 2017 09:09
How to release foreman packages into Copr

Foreman in Copr

This document describes how the Copr projects for Foreman are created and how to build packages in them.

Copr projects

We've created two Copr projects.

@FrostyX
FrostyX / README.md
Last active February 15, 2018 21:07
Copr APIv3 samples
@FrostyX
FrostyX / README.md
Last active May 6, 2018 20:19
Copr APIv3 - migration table
Status Function API version APIv3 name
[x] authentication_check(...) APIv1 general_proxy.auth_check
[x] get_build_details(...) APIv1 build_proxy.get
[x] cancel_build(...) APIv1 build_proxy.cancel
[x] delete_build(...) APIv1 build_proxy.delete
[x] create_new_build(...) APIv1 build_proxy.create_from_url build_proxy.create_from_urls build_proxy.create_from_file
[x] create_new_build_pypi(...) APIv1 build_proxy.create_from_pypi
[x] create_new_build_tito(...) APIv1 obsolete
[x] create_new_build_mock(..) APIv1 obsolete