- Clone https://github.com/vysheng/tg/, and install all necessary dependencies
- Apply
documents.patch
, then./configure && make
pip3 install pytg
- Modify
main.py
and changetgdir
to the correct path. - Log in your tg-cli
nohup ./bin/telegram-cli --json -R -W -P 4458 --permanent-peer-ids --permanent-peer-ids > /dev/null &
nohup python3 kagami.py > /dev/null &
sudo sh -c 'echo "auth sufficient pam_tid.so" > /etc/pam.d/sudo_local' |
CREATE OR REPLACE FUNCTION pseudo_encrypt(VALUE bigint) returns bigint AS $$ | |
DECLARE | |
l1 bigint; | |
l2 bigint; | |
r1 bigint; | |
r2 bigint; | |
i int:=0; | |
BEGIN | |
l1:= (VALUE >> 32) & 4294967295::bigint; | |
r1:= VALUE & 4294967295; |
Prefix | Description | Notes | |
---|---|---|---|
ac_ | Platform Client ID | Identifier for an auth code/client id. | |
acct_ | Account ID | Identifier for an Account object. | |
aliacc_ | Alipay Account ID | Identifier for an Alipay account. | |
ba_ | Bank Account ID | Identifier for a Bank Account object. | |
btok_ | Bank Token ID | Identifier for a Bank Token object. | |
card_ | Card ID | Identifier for a Card object. | |
cbtxn_ | Customer Balance Transaction ID | Identifier for a Customer Balance Transaction object. | |
ch_ | Charge ID | Identifier for a Charge object. | |
cn_ | Credit Note ID | Identifier for a Credit Note object. |
''' | |
rate_limit2.py | |
Copyright 2014, Josiah Carlson - [email protected] | |
Released under the MIT license | |
This module intends to show how to perform standard and sliding-window rate | |
limits as a companion to the two articles posted on Binpress entitled | |
"Introduction to rate limiting with Redis", parts 1 and 2: |
ActiveRecord::Base.module_eval do | |
class << self | |
def inherited_with_paper_trail(subclass) | |
skip_models = %w(schema_migrations versions) | |
inherited_without_paper_trail(subclass) | |
table_name = subclass.table_name | |
if !skip_models.include?(table_name) && table_name.present? |
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
#!/bin/bash | |
#encrypt files with aes-256-cbc cipher using openssl | |
#install: | |
# sudo wget -O /usr/bin/enc https://gist.github.com/krisf/5391210/raw/4a105a6b8f98f39e9e74a1dd2a78ef6f631acdb1/enc | |
# sudo chmod +x /usr/bin/enc | |
# enc --help | |
#encrypt files | |
if [ $1 == "-e" ]; | |
then |
upstream some_app_server { | |
server 127.0.0.1:9393; | |
} | |
server { | |
listen 80; | |
server_name my-upload-endpoint.com ; | |
I wrote a middleware (actually two, but they do the same with different implementations) that logs information about signed in scopes in a Rails + Devise application. The solution works with multiple logins (like having a person logged both as an Admin
and a User
). I tested against Rails 4 and Devise HEAD
, but it should work fine in any Rails 3 application.
This solution doesn't use the log_tags
configuration option since it isn't very helpful when you need to retrieve information stored in cookies/session. That information isn't 'ready' when the Rails::Rack::Logger
is executed, since it happens way down in the middleware chain.
Add one of the following implementations to your application load path and use the following configuration to add the middleware to your application stack:
# application.rb