Posts Tagged ‘hacks’

Usable Sec: 5 Simple PW Hacks

  1. Asking: Amazingly the most common way to gain access to someone’s password is simply to ask for it (often in relation with something else). People often tell their passwords to colleagues, friends and family. Having a complex password policy isn’t going to change this.
  2. Guessing: This is the second most common method to access a person’s account. It turns out that most people choose a password that is easy to remember, and the easiest ones are those that are related to you as a person. Passwords like: your last name, your wife’s name, the name of your cat, the date of birth, your favorite flower etc. are all pretty common. This problem can only be solved by choosing a password with no relation to you as a person.
  3. Brute force attack: Very simple to do. A hacker simply attempts to sign-in using different passwords one at the time. If you password is “sun”, he will attempt to sign-in using “aaa, aab, aac, aad …sul, sum, sun (MATCH)“. The only thing that stops a brute force attack is higher complexity and longer passwords (which is why IT people want you to use just that).
  4. Common word attacks: A simple form of brute-force attacks, where the hacker attempt to sign-in using a list of common words. Instead of trying different combination of letters, the hacker tries different words e.g. “sum, summer, summit, sump, sun (MATCH)“.
  5. Dictionary attacks: Same concept as common word attacks – the only difference is that the hacker now uses the full dictionary of words (there are about 500,000 words in the English language).

it takes the following time to hack a simple password like “sun“:

  • Brute-force: 3 minutes
  • Common Word: 3 minutes
  • Dictionary: 1 hour 20 minutes

Ten 1-line R Hacks to Boost your Productivity

Here are 10 1-line R hacks that will streamline your workflow and increase your productivity.


1. Install problematic packages from source (solves 99% of installation problems)

install.packages(file_name_and_path, repos = NULL, type="source")

The Bash/shell equivalent would be:

 R CMD INSTALL source.library 

2. Count number of unique rows with a condition

 length(unique(df$col[df$col > 0])) 

Rlogo3. Force R not to use scientific notation

options("scipen"=100, "digits"=4)

4. Count number of non-unique, non-NA rows with a condition

sum(data$x<0, na.rm=T)

5. Randomly order rows (useful for drawing a random sample)


6. Conduct pattern matching with wildcards (no REGEX required)

 glob2rx("blue*")[1] "^blue"

7. Add a column of row numbers to a dataframe/object

df$row <- 1:nrow(df)

8. Loop through each unique date and build a subset

uniq <- unique(unlist(data$Date)); for (i in 1:length(uniq)){ data_1 <- subset(data, date == uniq[i]) #your desired function}

9. Drop columns by name <-[, !names( %in% c(“name”, “name1”, “name2”)]

10. Append something to column names

names(df) <-  str_c(nam, '.yourstring’)