Skip to content

Instantly share code, notes, and snippets.

View ombak's full-sized avatar
🎯
Focusing

Sukma Saputra ombak

🎯
Focusing
View GitHub Profile
# -*- coding: utf-8 -*-
def bubbleSort(mylist):
# outer loop
for i in range(len(mylist)-1, 0, -1):
# inner loop
for j in range(i):
if mylist[j] > mylist[j+1]:
# swap the value
temp = mylist[j]
SELECT @@global.secure_file_priv;
-- karena saya menggunakan linux Debian 9, hasilnya adalah sebagai berikut
-- /var/lib/mysql-files
SELECT iso, name, nicename, iso3, numcode, phonecode
FROM countries
INTO OUTFILE '/var/lib/mysql-files/countries01.csv'
FIELDS ENCLOSED BY ''
TERMINATED BY ','
ESCAPED BY ''
LINES TERMINATED BY '\r\n';
curl -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-`uname -s`-`uname -m` >/tmp/docker-machine && chmod +x /tmp/docker-machine && sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
tail -n 3 jan2017articles.csv
tail -n 3 jan2017articles.csv
# 02 Jan 2017,Article,Scott Nesbitt,3 tips for effectively using wikis for documentation,1,/article/17/1/tips-using-wiki-documentation,"Documentation, Wiki",710
# 02 Jan 2017,Article,Jen Wike Huger,The Opensource.com preview for January,0,/article/17/1/editorial-preview-january,,358
# 02 Jan 2017,Poll,Jason Baker,What is your open source New Year's resolution?,1,/poll/17/1/what-your-open-source-new-years-resolution,,186
head -n 1 jan2017articles.csv
#Post date,Content type,Author,Title,Comment count,Path,Tags,Word count
wc -l jan2017articles.csv
# 93 jan2017articles.csv
grep -i "security" jan2017articles.csv
#30 Jan 2017,Article,Tiberius Hefflin,4 ways to improve your security online right now,3,/article/17/1/4-ways-improve-your-online-security,Security and encryption,1242
#28 Jan 2017,Article,Subhashish Panigrahi,How communities in India support privacy and software freedom,0,/article/17/1/how-communities-india-support-privacy-software-freedom,Security and encryption,453
#27 Jan 2017,Article,Alan Smithee,Data Privacy Day 2017: Solutions for everyday privacy,5,/article/17/1/every-day-privacy,"Big data, Security and encryption",1424
#04 Jan 2017,Article,Daniel J Walsh,50 ways to avoid getting hacked in 2017,14,/article/17/1/yearbook-50-ways-avoid-getting-hacked,"Yearbook, 2016 Open Source Yearbook, Security and encryption, Containers, Docker, Linux",2143
grep -i "security" jan2017articles.csv | wc -l
# 4
grep "20 Jan 2017" jan2017articles.csv | tr ',' '\t' > jan20only.tsv