Skip to content

Instantly share code, notes, and snippets.

View akalongman's full-sized avatar
:octocat:
Loving Open Source

Avtandil Kikabidze akalongman

:octocat:
Loving Open Source
View GitHub Profile
@akalongman
akalongman / port_scanner.php
Created May 7, 2014 12:32
Port scanner on PHP
<?php
ini_set('max_execution_time', 0);
ini_set('memory_limit', -1);
$host = 'google.com';
$ports = array(21, 25, 80, 81, 110, 143, 443, 587, 2525, 3306);
foreach ($ports as $port)
{
$connection = @fsockopen($host, $port, $errno, $errstr, 2);
private function generateRedirectUrl(Order $order): ?string
{
if (! $order->isPaymentTypeBank()) {
return null;
}
$requestUri = [
'lang_code' => config('project.payments.merchant.lang_code'),
'merch_id' => config('project.payments.merchant.merch_id'),
'o.order_id' => $order->getId(),
<?php
declare(strict_types=1);
namespace App\Http\Controllers\Api\V1;
use App\Models\Order;
use App\Services\OrdersService;
use App\Services\PurchaseService;
use Illuminate\Http\Request;
@akalongman
akalongman / Main.java
Created November 29, 2023 09:01
Parse PHP Serialized object in Java
import org.json.*;
public class Main {
public static void main(String[] args) {
String str = ";{\"uuid\":\"d1d06498-294d-430e-a7ca-b21a01e5a5dd\",\"displayName\":\"App\\\\Jobs\\\\SendSmsOneJob\",\"job\":\"Illuminate\\\\Queue\\\\CallQueuedHandler@call\",\"maxTries\":null,\"maxExceptions\":null,\"failOnTimeout\":false,\"backoff\":null,\"timeout\":null,\"retryUntil\":null,\"data\":{\"commandName\":\"App\\\\Jobs\\\\SendSmsOneJob\",\"command\":\"O:22:\\\"App\\\\Jobs\\\\SendSmsOneJob\\\":2:{s:4:\\\"data\\\";s:303:\\\"{\\\"subject\\\":\\\"Photocenter\\\",\\\"message\\\":\\\"ბოლო მესიჯი გამოგზავნილია 11:45\\\",\\\"phone\\\":\\\"995555555\\\",\\\"ignore_blacklist\\\":true,\\\"company_id\\\":115,\\\"type\\\":\\\"transactional_messages\\\",\\\"ip_address\\\":\\\"213.217.16.42\\\",\\\"uuid\\\":\\\"55021d6f-20ec-49db-9269-f51b7166b35d\\\",\\\"sms_type\\\":\\\"a2p\\\"}\\\";s:5:\\\"queue\\\";s:7:\\\"a2p_one\\\";}\"},\"sentry_baggage_data\":\"sentry-trace_id=03203501f21e4a829e635323149697c5,sentry-public_key=2f8
@akalongman
akalongman / php-soap.php
Created April 1, 2015 08:44
PHP soap client example
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$params = array('param1'=>$param1);
$wsdl = 'http://service_url/method?WSDL';
@akalongman
akalongman / build.gradle
Created March 20, 2015 10:21
Android build.gradle example
apply plugin: 'com.android.application'
def getBuildDate() {
def date = new Date()
def formattedDate = date.format("yyyy-MM-dd'T'HH:mm:ss'Z'")
return formattedDate
}
def BUILD_DATE = getBuildDate()
android {
[Adblock Plus 2.0]
! Version:
! Title: GeoList
! Last modified:
! Expires: 4 days (update frequency)
! Homepage: https://longman.me/
! Licence: https://longman.me/licence.html
!
! Please report any unblocked adverts or problems
! in the gist (https://gist.github.com/akalongman/91b45a1f4871afdfa79d83b0e3d05d1b)
@akalongman
akalongman / mysql-sync.sh
Created October 18, 2017 08:11
Sync one database to second using `pt-table-sync` + sync table structures as well
#!/bin/bash
# Fix for cron incorrect paths
HOME='/root'
# Sync database1 to database2
SRC_DB='database1'
DST_DB='database2'
EXCLUDE_TABLES=(table1 table2)
@akalongman
akalongman / gulpfile.js
Created November 4, 2015 11:42
Gulp task for uploading files to ftp/sftp server based on Sublime Text sftp-config.json configuration file
const gutil = require('gulp-util');
const ftp = require( 'vinyl-ftp' );
const sftp = require('gulp-sftp');
// task for deploying files on the server
gulp.task('deploy', function() {
const config = require('./sftp-config.json');
const globs = [
'folder/file',
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Project code style checker config">
<rule ref="../vendor/longman/php-code-style/longish.phpcs.xml">
</rule>
<!-- Ban some functions -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="sizeof" value="count"/>