[Quick Links] |
Search Site

Site Details

rendered in 0.3121 secs

Captain's Log | Thursday 28th of September 2017

generate new key pair | linux security ref

update: i tried the ed25519 key, but had issues syncing from phone, as FolderSync didn't support the key type. ended up back with rsa key
check existing keys
for keyfile in ~/.ssh/id_*; do ssh-keygen -l -f "${keyfile}"; done | uniq
generate new key on CLIENT MACHINE - NOT SERVERS
ssh-keygen -t rsa -b 4096 -o -a 100
ssh into server with existing key, and update athorized_keys with new public key, no need to put pub or private key on actual server!!
update authorized_keys FOR ALL ACCOUNTS ALLOWED IN /etc/ssh/sshd_config (you must have users configured here, that's how we know which authorized_keys files to check to ensure only these accounts have access to the system)

repeat for home infrastructure (dan, prox)

Captain's Log | Sunday 17th of September 2017

Composer: remove a package, clean up dependencies, don't update other packages | ref delete


Remove the entry from composer.json then run composer update phpmd/phpmd

Captain's Log | Wednesday 13th of September 2017

git public key denied | ssh repo push pull

cat /home/dave111/.ssh/id_rsa.pub >> /home/novajizz/.ssh/authorized_keys

rss2email r2e rss2mail how to add new feed

r2e add friendlyname http://www.gsmarena.com/rss-news-reviews.rss e@mailaddress.io

r2e config file location | src

~/.config/rss2email.cfg

codeigniter form validation check if exists callback

        public function optionsForm() {
            $this->load->library('form_validation');
            $this->form_validation->set_rules('email', 'Email Address', 'valid_email|trim|required|xss_clean|callback_checkEmailExists');
            $this->form_validation->set_rules('hideOffline', 'Hide Offline Nodes', 'xss_clean');

            if($this->form_validation->run() == FALSE) {
                $this->options();
            } else {
                $data = array(
                    'email'         => $this->input->post('email'),
                    'hideOffline'   => $this->input->post('hideOffline'),
                );
                $this->db->where('id', $this->session->userdata('user_id'));
                $this->db->update('user', $data);

                $new_session_data = array(
                    'hideOffline'   => $this->input->post('hideOffline'),
                    'user_email'    => $this->input->post('email'),
                ); //update current session data
                $this->session->set_userdata($new_session_data);
                $this->session->set_flashdata('message', 'Configuration saved at '.date('H:i:s'));
                redirect(base_url()."user_options/options"); //if you just load $this->options the flashmessage is like one refresh behind
            }

        }

        public function checkEmailExists() {
            $this->db->where('email', $this->input->post('email'));
            $emailCheckExist = $this->db->get('user');
            if($emailCheckExist->num_rows() > 0) {
                $this->form_validation->set_message('checkEmailExists', 'Email address is already in use by another account.');
                return FALSE;
            } else {
                return TRUE;
            }
        }


Captain's Log | Wednesday 13th of September 2017

Common Linux file and folder permissions | chmod chown octal home src


Here is a list of some common settings, numerical values and their meanings:
-rw------- (600) — Only the owner has read and write permissions.
-rw-r--r-- (644) — Only the owner has read and write permissions; the group and others have read only.
-rwx------ (700) — Only the owner has read, write, and execute permissions.
-rwxr-xr-x (755) — The owner has read, write, and execute permissions; the group and others have only read and execute.
-rwx--x--x (711) — The owner has read, write, and execute permissions; the group and others have only execute.
-rw-rw-rw- (666) — Everyone can read and write to the file. (Be careful with these permissions.)
-rwxrwxrwx (777) — Everyone can read, write, and execute. (Again, this permissions setting can be hazardous.)

Here are some common settings for directories:
drwx------ (700) — Only the user can read, write in this directory.
drwxr-xr-x (755) — Everyone can read the directory; users and groups have read and execute permissions.


Captain's Log | Tuesday 5th of September 2017

save git credentials for pushing to github from command line | creds ref


You've probably checked out the repo as https rather than ssh.
git clone ssh://github.com/rickoneeleven/fizzbuzz