Skip to content

Instantly share code, notes, and snippets.

View bakytn's full-sized avatar

Bakyt Niyazov bakytn

  • Bishkek, Kyrgyz Republic
View GitHub Profile
@antonputra
antonputra / gist:533fdd507f797cc30b082eed2c4f6fb4
Created August 23, 2024 20:22
Golang Dockerfile with upx
FROM golang:1.23.0-bookworm AS build
ARG upx_version=4.2.4
RUN apt-get update && apt-get install -y --no-install-recommends xz-utils && \
curl -Ls https://github.com/upx/upx/releases/download/v${upx_version}/upx-${upx_version}-amd64_linux.tar.xz -o - | tar xvJf - -C /tmp && \
cp /tmp/upx-${upx_version}-amd64_linux/upx /usr/local/bin/ && \
chmod +x /usr/local/bin/upx && \
apt-get remove -y xz-utils && \
rm -rf /var/lib/apt/lists/*
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@mRoca
mRoca / DockerInDocker.gitlab-ci.yml
Last active September 5, 2017 05:41
gitlab-ci with docker
# TODO add the docker volume dir in /cache
before_script:
- docker info
- docker build -t thom-platine/tests tests/docker/
- docker run --name thom-platine-tests -v $(pwd):/var/www/ -v /cache:/cache -e "COMPOSER_CACHE_DIR=/cache/composer" -d thom-platine/tests tail -f /dev/null
- docker exec thom-platine-tests composer install --no-interaction
stages:
- test
@ronanguilloux
ronanguilloux / pre-commit
Last active May 21, 2024 10:17 — forked from cjsaylor/pre-commit
phplint + phpcs + php-cs-fixer PHP-related pre-commit git hook (needs to add squizlabs/php_codesniffer & fabpot/php-cs-fixer to your composer.json)
#!/bin/sh
# @source: https://gist.github.com/ronanguilloux/11f6a788358577474ab4
# @link http://tech.zumba.com/2014/04/14/control-code-quality/
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
@massar
massar / server-git.conf
Created March 6, 2014 21:14
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
$inputFilter->add($factory->createInput(array(
'name' => 'username',
'required' => true,
'filters' => array(
array('name' => 'StripTags'),
array('name' => 'StringTrim'),
),
'validators' => array(
array(
'name' => 'StringLength',
@kenshinx
kenshinx / client.go
Last active February 3, 2024 18:49
golang socket server & client ping-pong demo
package main
import (
"os"
"log"
"net"
"strconv"
"strings"
)
@sandys
sandys / email_attachments_ses_simple.php
Created January 23, 2013 10:33
Script to send email using Amazon SES with attachments in PHP
<?php
require("./amazon-sdk/sdk.class.php");
// on ubuntu - this script can be run using php5-cli and php5-curl
//Provide the Key and Secret keys from amazon here.
$AWS_KEY = "kkk";
$AWS_SECRET_KEY = "kkkk+xKcdkB";
//certificate_authority true means will read CA of amazon sdk and false means will read CA of OS
$CA = true;
@ralphschindler
ralphschindler / example.php
Created October 24, 2012 23:18
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';
@proofek
proofek / pre-receive
Created June 2, 2011 14:21
pre-receive git hook to run php linter
#!/usr/bin/php
<?php
echo "\nRunning php linter...\n";
$params = explode(' ', file_get_contents('php://stdin'));
$ref = trim($params[1]);
$diff = array();
$return = 0;