Skip to content

Instantly share code, notes, and snippets.

View DaedalusX's full-sized avatar
🤠
Codin'

George Cooper DaedalusX

🤠
Codin'
View GitHub Profile
@DaedalusX
DaedalusX / aws-ec2-redis-cli.md
Created November 17, 2021 08:28 — forked from paladini/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

@DaedalusX
DaedalusX / recover_source_code.md
Created March 11, 2017 23:18 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@DaedalusX
DaedalusX / recover_source_code.md
Created March 11, 2017 23:18 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@DaedalusX
DaedalusX / ovpn-writer.sh
Created April 21, 2016 22:50 — forked from renatolfc/ovpn-writer.sh
Script to generate an OpenVPN client configuration file in the unified format
#!/bin/sh
##
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
client_key=${4?"The path to the client private key file is required"}

Keybase proof

I hereby claim:

  • I am daedalusx on github.
  • I am merovingian (https://keybase.io/merovingian) on keybase.
  • I have a public key whose fingerprint is 492F A3E6 B2E9 F8A5 C8A2 148A 1DFD A8AA C7FE 81AC

To claim this, I am signing this object:

public function getShippingAddressTotals($address)
{
$totals = $address->getTotals();
foreach ($totals as $total) {
if ($total->getCode()=='grand_total') {
if ($address->getAddressType() == Mage_Sales_Model_Quote_Address::TYPE_BILLING) {
$total->setTitle($this->__('Total'));
}
else {
$total->setTitle($this->__('Total for this address'));