Skip to content

Instantly share code, notes, and snippets.

View ihordiachenko's full-sized avatar

Ihor Diachenko ihordiachenko

View GitHub Profile
@ihordiachenko
ihordiachenko / fix_local.sh
Created June 8, 2016 15:38
Fix locale on Ubuntu
sudo sh -c "printf '%s\n' \
'LANGUAGE=en_US.UTF-8' \
'LC_ALL=en_US.UTF-8' \
'LANG=en_US.UTF-8' \
'LC_TYPE=en_US.UTF-8' \
> /etc/default/locale"
locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
#reboot
@ihordiachenko
ihordiachenko / pem_to_pfx.sh
Last active July 4, 2017 14:00
Convert PEM certificate to PFX
openssl pkcs12 -export -out hufsy.pfx -inkey hufsy_com.key -in hufsy_com.crt
@ihordiachenko
ihordiachenko / ssh_proxy.sh
Last active July 4, 2017 14:03
SSH Proxy
ssh -fN [email protected] -L 7777:myserver.com:8888
@ihordiachenko
ihordiachenko / netstat_mac.sh
Last active July 4, 2017 14:02
OS X `netstat -tupln` alternative
sudo lsof -i -n -P
@ihordiachenko
ihordiachenko / get_table_creation_script.sh
Created July 15, 2017 14:24
Get the PostgreSQL table creation script
pg_dump -U $USER $DB -t $TABLE --schema-only
@ihordiachenko
ihordiachenko / undo_rebase.sh
Created July 29, 2017 15:14
Undo the git rebase
git rebase --onto master server client
@ihordiachenko
ihordiachenko / check_ignore.sh
Created October 25, 2017 14:55
Check if a given file is ignored by git
git check-ignore -v foo/bar.sh
xcode-select --install
describe('init', function() {
beforeEach(function() {
ctrl.statistics = undefined;
sinon.stub(ctrl.statisticsService, 'getRangeVerbose');
sinon.stub(ctrl, 'initRangePicker');
sinon.stub(ctrl, 'watchFilters');
sinon.stub(ctrl, 'pick');
sinon.stub(ctrl, 'getFilters');
});
@ihordiachenko
ihordiachenko / suicide_bomber.sol
Created April 19, 2018 12:55
Force ether to a contract
pragma solidity ^0.4.21;
/**
* This contract allows to force Ether into a contract.
*/
contract SucideBomber {
function SucideBomber() payable {}
function boom(address target) public {
selfdestruct(target);