Skip to content

Instantly share code, notes, and snippets.

View adastreamer's full-sized avatar
🤺
What's happening?

Eugene Khashin adastreamer

🤺
What's happening?
View GitHub Profile
#!/bin/bash
PORT_FILE=/home/deployer/PORT
APP_DIR=/var/www/cryptoprocessing
APP_PIDS_DIR=$APP_DIR/tmp/pids
UPSTREAM_CONFIG_FILE=/home/deployer/UPSTREAM_SERVERS
PORT=$(cat $PORT_FILE)
if [ "$PORT" == "3000" ]
then
<div class="col-12 col-md-4 text-center text-bold">
<h2 class="number" id="contract-balance">$135 000</h2>
<p class="text mt-0">Баланс смарт-контракта</p>
</div>
<div class="col-12 col-md-4 text-center text-bold">
<h2 class="number" id="investors-count">10</h2>
<p class="text mt-0">Количество инвесторов</p>
</div>
<div class="col-12 col-md-4 text-center text-bold">
<h2 class="number" id="tokens-count">10 342</h2>
public void makeRequest(final String url, final String json) {
Runnable runable = new Runnable() {
public void run() {
try{
OkHttpClient client = new OkHttpClient();
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
Request request = new Request.Builder()
.header("User-Agent", "Mozilla/5.0 (Linux; Android 6.0.1; SM-webview_android_dl Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 Mobile Safari/537.36")
.addHeader("Content-Type","application/json")
@adastreamer
adastreamer / entrypoint.sh
Created May 19, 2017 19:08
An example of Docker entrypoint which does an exec of RUN command
#!/bin/bash
echo "Seeding the files..."
if [ ! -f /data/.do_not_init_me ]; then
echo "Copying the initial files..."
rm -rf /data/.* 2> /dev/null
cp -pri /data_init/. /data/
else
echo "Skipping the initial seeding!"
@adastreamer
adastreamer / out.bash
Created January 23, 2017 22:49
error kupon create deal
Started POST "/admin/deals" for 127.0.0.1 at 2017-01-24 01:43:46 +0300
ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Admin::DealsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"D6MqHlK8O1Z56IzKH0UDPSisGn0Wc3Wz4Q3/cLL4coY=", "deal"=>{"organization"=>"Доккур", "organization_id"=>"1", "category_ids"=>["", "11", "13", "15", "17", "19"], "coupon_count"=>"200", "coupons_per_user"=>"200", "start_date"=>"2017-01-23", "end_date"=>"2017-03-31", "theme"=>"Хостинг бесплатно", "alias"=>"hosting-besplatno", "location_ids"=>["", "1", "2", "3"], "features"=>"<p>Всем хостинг бесплатно</p>", "terms"=>"<p>Просто берете и получаете</p>", "how_coupon_works"=>"<p>Он просто берет и работает</p>", "extra_text"=>"<p>Тут дополнительная информация</p>", "phones"=>"+79051222266", "address"=>"Moscow street, 56", "metro"=>"Кавалерийская", "district"=>"", "longitude"=>"27.593600708984354", "latitude"=>"53.881055228815754", "full_price"=>"3000",
@adastreamer
adastreamer / startup.sh
Last active January 14, 2017 21:55
VM First Startup Configuration for Jenkins [Azure]
# General Configuration:
# Name: ubuntu-16-04-d4-v2
# Labels: docker
# Virtual Machine Size: Standard_D4_v2
# Storage Account Name: [leave blank]
# Retention Time: 0
#
# Image Configuration:
# Image Reference:
# Image Publisher: canonical
@adastreamer
adastreamer / Podfile
Created January 12, 2017 13:25
АвтоЭксперт Podfile
target 'SlideOutMenu' do
project 'SlideOutMenu.xcodeproj'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'Google/Analytics'
pod 'Fabric'
pod 'Crashlytics'
wget https://github.com/Azure/azurefile-dockervolumedriver/releases/download/v0.5.1/azurefile-dockervolumedriver
chmod +x azurefile-dockervolumedriver
sudo cp azurefile-dockervolumedriver /usr/bin/
rm azurefile-dockervolumedriver
git clone https://github.com/Azure/azurefile-dockervolumedriver.git
sudo cp azurefile-dockervolumedriver/contrib/init/systemd/azurefile-dockervolumedriver.default /etc/default/azurefile-dockervolumedriver
sudo vi /etc/default/azurefile-dockervolumedriver
sudo cp azurefile-dockervolumedriver/contrib/init/systemd/azurefile-dockervolumedriver.service /etc/systemd/system/azurefile-dockervolumedriver.service
sudo passwd docker-user
sudo systemctl daemon-reload
FROM node:latest
ADD . /app/content
RUN apt-get update && apt-get install -y imagemagick graphicsmagick
RUN cd /app/content && \
node bin/install.js
EXPOSE 8080
def delete(**kwargs):
connection_id = kwargs.get('connection_id', '')
service = Service.get(name = connection_id)
return service