Skip to content

Instantly share code, notes, and snippets.

View hirios's full-sized avatar

Alan Rios hirios

  • Brazil
View GitHub Profile
@inpromotion
inpromotion / win_cmd_commands_by_xpuct
Last active February 22, 2021 02:13
Полезная Командная строка в Windows (урок от XpucT). Видео: https://youtu.be/A1B7zgR7qF4
Завершение процесса в точное время Windows XP/Vista/7:
at 11:00 Taskkill /f /IM winamp.exe /T
Завершение процесса в точное время Windows 8/8.1/10:
schtasks /create /tn termination /tr "taskkill /f /t /im winamp.exe" /sc once /st 11:00
Выключить комп через час:
shutdown.exe -s -t 3600
Перезагрузить комп сейчас же:
// ==UserScript==
// @name Disable Page Visibility API
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Disables JS events on whole page focus/unfocus. Usefull to prevent ads stop when switching to another tab.
// @author Louis Chanouha
// @match *://*/*
// @grant none
// ==/UserScript==
@klein-artur
klein-artur / urlSplitterRegex.md
Last active January 10, 2022 18:56
Regex to split an url into its parts:

Regex to split an url into its parts:

This regex splits an http or https url into its parts.

^(?:(?:(?:(http[s]?):\/\/)(?:([a-zA-Z0-9]+)?\.)?([^:\/\s\?]+\.+[^:\/\s\?]+))?(?:((?:\/[^\/\s]+)*\/)?(?:([\w\-\.]+[^#?\s]+))?)?(#[^#?\s]+)?(?:\?+([^\.\s$]+)?)?)$

Groups

  1. Whole match
@tzmartin
tzmartin / embedded-file-viewer.md
Last active May 1, 2024 14:41
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@keberwein
keberwein / restart_nginx.bat
Created September 2, 2016 16:28
Restart Nginx Windows
@ECHO OFF
cd /nginx
taskkill /f /IM nginx.exe
start nginx
EXIT
@ronreiter
ronreiter / sqlalchemy_example.py
Created August 10, 2015 06:21
SQLAlchemy Example
from sqlalchemy import Column, Integer, String, ForeignKey, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessionmaker, joinedload
# For this example we will use an in-memory sqlite DB.
# Let's also configure it to echo everything it does to the screen.
engine = create_engine('sqlite:///:memory:', echo=True)
# The base class which our objects will be defined on.
Base = declarative_base()
@KhepryQuixote
KhepryQuixote / PyTorStemPrivoxy.md
Last active September 9, 2023 20:36
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.