This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select to_char(to_date('1970-01-01 00', 'yyyy-mm-dd hh24') + (1601921560000)/1000/60/60/24, 'YYYY-MM-DD HH12:MI:SS am') datestr from dual; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to ~/.bashrc | |
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[\033[00;32m\]\$(git_branch)\[\033[00m\]\$ " | |
# After saving, run this | |
source ~/.bashrc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Starts a single node instance of cockroach on localhost | |
cockroach start-single-node --insecure --listen-addr=localhost --http-addr=localhost:PORT_NUM | |
# example of how to connect sql prompt to "cluster" | |
cockroach sql --insecure --database=database_name | |
# Create a database, user, grant permissions | |
create database if not exists database_name; | |
create user if not exists admin_user; | |
create user if not exists normal_user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create /data location as a "mount" for apps to hit and for application installs | |
mkdir -p /mnt/c/data/apps | |
sudo ln -s /mnt/c/data /data | |
# mount your code directory to /code | |
sudo ln -z /mnt/c/Users/[USER_NAME]/code /code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (outcome == success) of /deployment=my-deployment.war:read-attribute(name=status) | |
echo app is deployed, undeploying... | |
undeploy my-deployment.war | |
end-if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def order-details | |
{:name "Mitchard Blimmons" | |
:email "mitchard.blimmonsgmail.com"}) | |
(def order-details-validations | |
{:name | |
["Please enter a name" not-empty] | |
["Please enter an email address" not-empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ssh into your pi, most likely the "default" login (user: pi, password: raspberry) | |
ssh pi@raspberrypi | |
# find new ip address | |
ifconfig | grep inet | |
# update cupsd.conf (you may have to sudo) | |
cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup | |
vi /etc/cups/cupsd.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{kernel, | |
[{distributed, [{chucky, 5000, [a@Ryans-MBP, {b@Ryans-MBP, c@Ryans-MBP}]}]}, | |
{sync_nodes_mandatory, [b@Ryans-MBP, c@Ryans-MBP]}, | |
{sync_nodes_timeout, 30000} | |
]}]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select ix.owner, ix.index_name, ix.table_name, | |
ix.distinct_keys, ix.leaf_blocks, | |
s.blocks as segment_blocks, | |
s.bytes / 1048576 as size_in_mb, | |
to_char(ix.last_analyzed, 'YYYY-MM-DD HH24:MI') as last_analyzed | |
from all_indexes ix, dba_segments s | |
where ix.owner = s.owner and ix.index_name = s.segment_name | |
order by ix.table_name, ix.index_name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select column_name, avg_col_len, num_distinct, num_nulls | |
from all_tab_columns | |
where table_name = '<<table name>>' | |
order by column_id desc; |
NewerOlder