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 | |
c.owner, | |
c.object_name, | |
c.object_type, | |
b.sid, | |
b.serial#, | |
b.status, | |
b.osuser, | |
b.machine | |
from |
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 df.tablespace_name "Tablespace", | |
totalusedspace "Used MB", | |
(df.totalspace - tu.totalusedspace) "Free MB", | |
df.totalspace "Total MB", | |
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) | |
"Pct. Free" | |
from | |
(select tablespace_name, | |
round(sum(bytes) / 1048576) TotalSpace | |
from dba_data_files |
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
RewriteEngine on | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} !^www\. | |
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] |
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
#!/bin/bash | |
sudo tar xjf parallel-latest.tar.bz2 | |
cd parallel-yyyymmdd | |
sudo ./configure && make | |
sudo make install | |
# in case you need to relink the executable file | |
sudo ln -s /usr/bin/parallel /usr/local/bin/parallel |
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
import pandas as pd | |
d = pd.read_csv('CSV_FILE.csv', keep_default_na = False) | |
d.drop_duplicates(subset = ['COMPOSITE_KEY1', 'COMPOSITE_KEY2', 'COMPOSITE_KEY3', 'COMPOSITE_KEY4', 'COMPOSITE_KEY5', 'COMPOSITE_KEY6', 'COMPOSITE_KEY7', 'COMPOSITE_KEY8', 'COMPOSITE_KEY9', 'COMPOSITE_KEY10'], inplace = True, keep = 'first') | |
d.to_csv('CSV_FILE_PROCESSED.csv', index = False) |
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
version: '2' | |
tasks: | |
relocate: | |
cmds: | |
- echo " *** Relocating packages to {{.TARGET_PATH}} ***" | |
- task: replace-string | |
vars: { | |
SOURCE_STR: "{{.PACKAGE_NAME}}", | |
TARGET_STG: "{{.TARGET_PATH}}" |
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
GITHUB := "github.com" | |
PROJECTNAME := $(shell basename "$(PWD)") | |
PACKAGENAME := $(GITHUB)/$(shell basename "$(shell dirname "$(PWD)")")/$(PROJECTNAME) | |
GOBASE := $(shell pwd) | |
.PHONY .SILENT: relocate | |
## relocate: Relocate packages | |
relocate: | |
# Example: make relocate TARGET=github.com/wingkwong/myproject | |
@test ${TARGET} || ( echo ">> TARGET is not set. Use: make relocate TARGET=<target>"; exit 1 ) |
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
sqlite3 db.sqlite3 | |
sqlite> .mode csv | |
sqlite> .separator "," | |
sqlite> .import table1.csv table1 | |
sqlite> .import table2.csv table2 | |
sqlite> .import table3.csv table3 | |
sqlite> .import table4.csv table4 | |
sqlite> .exit |
NewerOlder