Skip to content

Instantly share code, notes, and snippets.

def clean_tweets(self, df):
"""
Takes raw tweets and cleans them
so we can carry out analysis
remove stopwords, punctuation,
lower case, html, emoticons.
This will be done using Regex
? means option so colou?r matches
both color and colour.
import mysql.connector
from mysql.connector import Error
import os
import re
import pandas as pd
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
from nltk.stem import WordNetLemmatizer
import nltk
@DFoly
DFoly / part1_Twitter.py
Last active October 31, 2018 10:00
Part 1 Twitter Blog Post
#!usr/bin/python
import mysql.connector
from mysql.connector import Error
import tweepy
import json
from dateutil import parser
import time
import os
import subprocess
YENİ PARDUS'U DEBOOTSTRAP İLE KURMAK
Bu kurulum yönteminde temel olarak “debootstrap” komutundan faydalanılacaktır. Bu işlem standart bir kurulum prosedürü olmadığından sisteminizi dilediğiniz gibi yapılandırmanıza imkan sağlayacak oldukça esnek bir yöntemdir ve pek çok farklı şekilde gerçekleştirilebilir.
Eğer daha önce “debootstrap” ile Debian temelli farklı işletim sistemlerinin kurulumlarını gerçekleştirdi iseniz Debian temelli Pardus (Pardus) için uygulayacağımız yöntemin çok da farklı olmayacağını baştan belirtmek isterim.
Bu işlemi yapabilmek için temel ihtiyaçlarınız:
Çalışan bir linux işletim sistemi: Linux kurmak için çalışan başka bir linux işletim sistemine sahip olunmasının gerekli olması ilk bakışta size biraz saçma gelebilir ama bir kurulum CD'si veya kurmadan çalışan linux CD'si de aslında çalışan bir linux işletim sistemidir. Bizim tam olarak ihtiyacımız ise “debootstrap” [1] betiğini/komutunu kullanabileceğimiz bir çalışan (genellikle linux çekirdeğine sahip) işletim sistemi. Biz örneğimi
@youkergav
youkergav / import.py
Last active August 29, 2022 22:55
Python script to import BreachCompilation to PostgreSQL database.
# Define imports.
from time import time, strftime
from datetime import datetime
from glob import iglob
from os import path, system
from sys import exc_info
from subprocess import Popen, PIPE
from curses import initscr, noecho, cbreak, echo, nocbreak, endwin
from psycopg2 import connect

#petya #petrWrap #notPetya

Win32/Diskcoder.Petya.C

Ransomware attack.

About

This gist was built by the community of the researchers and was scribed by Kir and Igor from the QIWI/Vulners. We are grateful for the help of all those who sent us the data, links and information. Together we can make this world a better place!

Gist updates

@aallan
aallan / mac-vendor.txt
Last active April 25, 2024 03:20
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@henrik
henrik / dokku_on_digital_ocean.md
Last active May 12, 2022 14:38
Notes from running Dokku on Digital Ocean.

My notes for Dokku on Digital Ocean.

These may be a bit outdated: Since I originally wrote them, I've reinstalled on a newer Dokku and may not have updated every section below.

Commands

Install dokku-cli (gem install dokku-cli) for a more Heroku-like CLI experience (dokku config:set FOO=bar).

# List/run commands when not on Dokku server (assuming a "henroku" ~/.ssh/config alias)

ssh henroku dokku