Skip to content

Instantly share code, notes, and snippets.

View silverwolfceh's full-sized avatar
🐱
I am a lazy CAT

Eric The Cat silverwolfceh

🐱
I am a lazy CAT
  • X-Force
  • Viet Nam
View GitHub Profile
@silverwolfceh
silverwolfceh / fbshield.py
Last active November 7, 2020 01:21
Turn on or off facebook shield (profile picture guard)
import requests
import json
USER_TOKEN = "" #Fill your fb user token (open https://facebook.com/me, ctrl +u and copy access token
SHIELD_ENABLE = "true" #Change to false if turn off shield
def get_userid(token):
url = "https://graph.facebook.com/me?access_token=%s" % token
@silverwolfceh
silverwolfceh / acceptmember.py
Created September 4, 2018 09:41
Accept group member
def add_remove_uid_in_group(uid, gid, config, atype = "post"):
access_token = config["config_tools"]["access_token"][0]
data = {"access_token": access_token, "method" : atype}
url = "https://graph.facebook.com/%s/members/%s" % (gid, uid)
while True:
try:
res = requests.post(url, data=data)
return res.text
except Exception as e:
print(e)
@silverwolfceh
silverwolfceh / token.js
Created October 14, 2018 04:54
Get Page Manager For IOS token
javascript:var uid = document.cookie.match(/c_user=(\d+)/)[1], dtsg = document.getElementsByName("fb_dtsg")[0].value, http = new XMLHttpRequest, app_id=prompt("App id", "165907476854626"), url = "//www.facebook.com/v1.0/dialog/oauth/confirm", params = "fb_dtsg=" + dtsg + "&app_id=" + app_id + "&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=page&access_token=&from_post=1&return_format=access_token&domain=&sso_device=ios&__CONFIRM__=1&__user=" + uid;http.open("POST", url, !0), http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), http.onreadystatechange = function() { if (4 == http.readyState && 200 == http.status) { var a = http.responseText.match(/access_token=(.*)(?=&expires_in)/); a = a ? a[1] : "Failed to get Access token make sure you authorized Page Manager For IOS app", prompt("Token", a); }}, http.send(params);
@silverwolfceh
silverwolfceh / getid.js
Created October 14, 2018 04:59
Get Facebook ID of page, group, profile
javascript:!function(){if(document.querySelector("div[class='_4-u2 _hoc clearfix _4adj _4-u8']")!=null){prompt("ID",document.querySelector("div[class='_4-u2 _hoc clearfix _4adj _4-u8']").getAttribute('id').split('_')[1])}else if(document.querySelector("a[class='_2dgj']")!=null){prompt("ID",document.querySelector("a[class='_2dgj']").getAttribute('href').split('/')[1])}else if(document.querySelector("div[id='pagelet_timeline_main_column']")!=null){prompt("ID",JSON.parse(document.querySelector("div[id='pagelet_timeline_main_column']").getAttribute('data-gt')).profile_owner)}}()
@silverwolfceh
silverwolfceh / fbcookielogin.js
Created October 14, 2018 05:02
Login facebook = cookie
javascript:void(function() { function setCookie(t) { var list = t.split("; "); console.log(list); for (var i = list.length - 1; i >= 0; i--) { var cname = list[i].split("=")[0]; var cvalue = list[i].split("=")[1]; var d = new Date(); d.setTime(d.getTime() + (7*24*60*60*1000)); var expires = ";domain=.facebook.com;expires="+ d.toUTCString(); console.log(expires); document.cookie = cname + "=" + cvalue + "; " + expires; } } var cookie = prompt("Input your cookie below", ""); setCookie(cookie); document.location.href="https://www.facebook.com";})();
@silverwolfceh
silverwolfceh / fbtokenlogin.js
Created October 14, 2018 11:38
Login Facebook using Token
javascript:void(function(){var token = prompt("Token", "EAAxxx"), appid = "", appurl = "https://graph.facebook.com/app?access_token=" + token, cookieurl = "https://api.facebook.com/method/auth.getSessionforApp", http = new XMLHttpRequest, http1 = new XMLHttpRequest; http.open("GET", appurl, true); http.onreadystatechange = function() { if (4 == http.readyState && 200 == http.status) { var a = http.responseText; console.log(a); var obj = JSON.parse(a); appid = obj.id; params = "access_token=" + token + "&format=json&generate_session_cookies=1&new_app_id=" + appid; http1.open("GET", cookieurl + "?" + params, true); http1.send(); } else if(4 == http.readyState && http.status == 400) { alert("Token is invalid!"); } }; http1.onreadystatechange = function() { if (4 == http1.readyState && 200 == http1.status) { var a = http1.responseText; var obj = JSON.parse(a); var d = new Date(); d.setTime(d.getTime() + (7*24*60*60*1000)); for(var i = 0; i < obj.session_cookies.length; i++) { document.cookie = obj.session_cookies
@silverwolfceh
silverwolfceh / trans.js
Created February 15, 2019 01:23
UTF8 Json parse javascript demo
function en2vi_trans(word)
{
var k = "trnsl.1.1.20190214T041113Z.bc4d15cca572abd8.xxxxxxxxxxxxxxxxxxxxxxxxxxxx"; //YANDEX API KEY, FREE
var url = "https://translate.yandex.net/api/v1.5/tr.json/translate?key=" + k + "&lang=en-vi&text=" + word;
return $.get(url, function(data) {
console.log(data);
info = JSON && JSON.parse(JSON.stringify(data)) || $.parseJSON(JSON.stringify(data));
if(info.code == 200)
{
var t = "Meaning of: " + word+ " is " + info.text[0];
@silverwolfceh
silverwolfceh / socketiocheatsheet.js
Created February 15, 2019 01:24
Socket IO cheatsheet
io.on('connect', onConnect);
function onConnect(socket){
// sending to the client
socket.emit('hello', 'can you hear me?', 1, 2, 'abc');
// sending to all clients except sender
socket.broadcast.emit('broadcast', 'hello friends!');
@silverwolfceh
silverwolfceh / pythonsshtunel.py
Created February 27, 2019 13:43
Chilkat python ssh tunel example
import chilkat2
import requests
chilkatGlob = chilkat2.Global()
success = chilkatGlob.UnlockBundle("chilkat_key")
if (success != True):
print(chilkatGlob.LastErrorText)
sys.exit()
status = chilkatGlob.UnlockStatus
@silverwolfceh
silverwolfceh / qt-without-xcode.md
Created April 5, 2019 13:36 — forked from shoogle/qt-without-xcode.md
Qt without XCode - how to use Qt Creator for macOS software development without installing XCode

Qt without Xcode

How to use Qt Creator for software development on macOS without having to install Xcode

Justification

Qt refuses to install on macOS unless Apple's Xcode is installed beforehand. This is unfortunate because: