Skip to content

Instantly share code, notes, and snippets.

View davidofug's full-sized avatar
💭
Collaborating

David Wampamba davidofug

💭
Collaborating
View GitHub Profile
@davidofug
davidofug / vesta-user-fix-permission.sh
Created June 28, 2020 12:29 — forked from 0x00dec0de/vesta-user-fix-permission.sh
Fix user permissions to vesta control panel
#!/bin/bash
cd /home/
for i in `ls | grep -v 'lost+found'`; do
if id "$i" &>/dev/null ; then
chattr -i /home/$i/conf
chown -R ${i}:${i} $i
chown root:root /home/$i/conf
chown root:root /home/$i/conf/*
chown root:bind /home/$i/conf/dns/* &>/dev/null
chown Debian-exim:mail /home/$i/conf/mail/* &>/dev/null
Disable the WordPress Admin Bar for all Users and Visitors
Turn off the toolbar with one simple line.
view plain
/*
* Disable the WordPress Admin Bar for all Users and Visitors
*/
remove_action( 'init', '_wp_admin_bar_init' );
^ top
Enable the WordPress Admin Bar for admins only
@davidofug
davidofug / findKey.js
Created June 16, 2018 12:47 — forked from DaveAtDog/findKey.js
JavaScript — Find key for value in an object
var findKey = function(obj, value)
{
var key = null;
for (var prop in obj)
{
if (obj.hasOwnProperty(prop))
{
if (obj[prop] === value)
{