Skip to content

Instantly share code, notes, and snippets.

View yushine's full-sized avatar

yushine yushine

View GitHub Profile
@yushine
yushine / README.md
Created December 6, 2021 06:09 — forked from paulgregg/README.md
Converting a gitlab export to simple git repo

Converting a gitlab export to simple git repo

Gitlab exports a tar.gz file which contains a file called project.bundle. We can convert this file into a normal git repo using the following steps:

Extract the project.bundle file

$ tar xvfz GitLabExport.gz
@yushine
yushine / AesCipher.java
Created September 17, 2021 10:43 — forked from demisang/AesCipher.java
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.support.annotation.Nullable;
import android.util.Base64;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
@yushine
yushine / README.md
Created June 9, 2021 09:19 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@yushine
yushine / Crontab.class.php
Created June 19, 2018 07:46 — forked from gustavgenberg/Crontab.class.php
Easy crontab manager for PHP. Uses shell_exec!
<?php
class Crontab {
/*
(c) Gustav Genberg 2017
This script uses PHP shell_exec! Make sure it is enabled before using!
Also make sure that the user running this script (usually www-data) have access to the crontab command!
@yushine
yushine / sphp.sh
Last active April 14, 2018 10:02 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@yushine
yushine / fix_git_sslread_9806.sh
Created June 24, 2017 01:46 — forked from entropiae/fix_git_sslread_9806.sh
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis/redis.pid
@yushine
yushine / Encrypt.php
Created January 23, 2017 07:18 — forked from vishnukumarpv/Encrypt.php
Encrypt and Decrypt with php
<?php
class Encrypt{
private function key( )
{
return $skey = "vishnu_kumar_aUlTIoQaBzk";
}
public function safe_b64encode($string) {
$data = base64_encode($string);
$data = str_replace(array('+','/','='),array('-','_',''),$data);
@yushine
yushine / gist:f15d421833275607de5dbcf0025c1ead
Created January 23, 2017 07:15 — forked from pwlin/gist:1248250
php custom encrypt/decrypt
<?php
function encrypt($string, $key=5) {
$result = '';
for($i=0, $k= strlen($string); $i<$k; $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result .= $char;
}
return base64_encode($result);
<?php
class encrypt
{
private $key;
private $uword;
private $eword;
private $letters;
/**