[Quick Links] |
Search Site

Site Details

rendered in 0.0873 secs

Captain's Log | Sunday 19th of February 2017

Pok3r programming macro keyboard | poker src shortcut


Toggle to one of the 3 programmable layers, Fn + ",", ".", or "/"
Enter programming mode, Fn + Right Ctrl
Press the key you want to program, in this case you'll press Fn + A
Press the command to assign (type out "h e l l o")
Press the Pn key to save the macro
Exit programming mode, Fn + Right Ctrl again

How to compare files / folders using diff | best way two

diff -rq -x '.git' /home/crabhands/repo/ /home/littledave/repo/
Show me the differences of these two directories, but exclude anything with ".git" in it.

Juniper Junos EX2200-C reset back to factory defaults | ex2200


Baud rate—9600
Flow control—None
Data—8
Parity—None
Stop bits—1
DCD state—Disregard
cd /config
rm jun*
cd db/config/
rm jun*
reboot

issues: not accepting keyboard input
solution: make sure below is configured
F - Hardware Flow Control : No

see what service / process is using a port | listening ports

sudo netstat -tulpn | grep :80
if you run it without sudo, it won't get the service name.

How to change linux into a NAT router with a single interface | one forward rules src


I did the bits in red to get it working on raspberry pi.
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
vim /etc/sysctl.conf:
net.ipv4.ip_forward = 1

iptables -A FORWARD -i eth1 -j ACCEPT

Codeigniter (2 at least), how to load and pass data from one controller to another | src CI

$this->load->library('../controllers/whathever');
and call the following method:
$this->whathever->functioname();
It can also cause things to go tits up, so sometimes it works, others it doesn't.

Captain's Log | Thursday 9th of February 2017

TDD Standards | test driven development php


Objective is for them to be followed for all projects, so requirements are minimum.
1. only models folder to be tested
2. we don't test libraries, 3rd party or sql queries
cellblock7Test.php has some great test examples, novascore project
-----------------------------------------------------------
example phpunit.xml html encode/decode
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit bootstrap="application/tests/bootstrap.php" stderr="true">
    <testsuites>
        <testsuite name="TestSuite">
            <directory>application</directory>
        </testsuite>
    </testsuites>
    <php>
        <const name="PHPUNIT_TEST" value="1" />
        <const name="PHPUNIT_CHARSET" value="UTF-8" />
        <server name="REMOTE_ADDR" value="0.0.0.0" />
        stderr="true"
    </php>
    <filter>
        <blacklist>
            <directory suffix=".php">system/</directory>
            <directory suffix=".php">application/tests/</directory>
            <directory suffix=".php">application/config/</directory>
            <directory suffix=".php">application/helpers/</directory>
            <directory suffix=".php">application/controllers/</directory>
            <directory suffix=".php">application/libraries/</directory>
        </blacklist>
        <whitelist>
            <directory suffix=".php">application/models/</directory>
            <exclude>
                <file>application/models/sqlqu.php</file>
            </exclude>

        </whitelist>
    </filter>

    <logging>
        <log type="coverage-html" target="/dave/loves/sausages"/>
        <log type="coverage-text" target="/dave/loves/sausages/formattxtlog.txt"/>
    </logging>
</phpunit>


Captain's Log | Saturday 4th of February 2017

linux ping show dropped / no replies / destination unreachable | request timed timeout

ping -O 8.8.4.4capital o, not zero

When creating a new website in webmin and enable ssl / https, it breaks all existing websites | stops working virtualmin


edit the site in /etc/sites-available and change the ssl listening address to *:443, then reload the apache service

sudo: service: command not found


only smarties have the answer
sudo /etc/init.d/networking restart

irssi commands

#connect to another server, whilst still connected to existing
/connect irc.freenode.net
   then you must hit "CTRL+x" in the status window to switch active server to the new one, before any join command etc

xdebug install and configure | setup


I'm afraid I haven't got a fucking clue. I managed to get it "working" by following this page. and then dropping zend_extension = /usr/lib/php5/20131226/xdebug.so

;xdebug configuration
xdebug.remote_host = 127.0.0.1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.remote_autostart=1
xdebug.idekey=PHPSTORM
into /etc/php5/mods-available/xdebug.ini, installed https://github.com/joonty/vdebug (actually did this bit first), and now when I hit F5 in vim, and just hit the site normally https://devhome.loopnova.com/ for example, with no funny port or ?xdebug string on the end, it just "works". my brain is melting out of my eye sockets.

update: set "xdebug.remote_autostart=0" and then append "?XDEBUG_SESSION_START=1" to the url, and it will start debug on load. If you don't do that, the debug may start on a page/script that anyone happens to load as soon as you hit f%, plus, word on the street is that having it set to zero makes apache run like a slut as it's always listening for the debug magic.

update2: interestingly, with the update, it now always catches the site im debugging, regardless of whether i pass the string, but now it lets all my other sites load normal, UNLESS i pass the string. fuck knows what's going down.

Captain's Log | Thursday 2nd of February 2017

Quick Links


)
-----------------------)
)