teleren/devto huggingface dataset:
Creating empty files with specific sizes
Tags: linux, dd, fsutil, windows
Published: 2014-02-07 14:02:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Creating empty files with specific sizes
slug: creating-empty-files-with-specific-sizes
date: 2014-02-07 14:02
tags: 
 - linux
 - dd
 - fsutil
 - windows
---

*Note from the future (Feb 3rd, 2020): just remember that DD stands for disk destroyer. Be careful using it, and never copypaste dd excerpts from the internet. Be safe.*

If you're doing speed tests, you may find yourself needing large files with which to test your connection speeds and stability.

On Linux, you can do this with `dd` like so, creating a 100 MB file (or thereabouts):

    dd if=/dev/zero of=output.png bs=1M count=100

On Windows servers, you can do this using `fsutil`, like so:

    fsutil file createnew output.png 104857600

Remember, 1024 bytes in a kilobyte, 1024*1024 bytes in a megabyte, and so forth.
Count files in a directory in Linux
Tags: linux, ls, wc, count
Published: 2014-02-05 09:43:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Count files in a directory in Linux
slug: count-files-in-a-directory-in-linux
date: 2014-02-05 09:43
tags: 
 - linux
 - ls
 - wc
 - count
---
Count files in current directory with:

    ls | wc -l

Or count files in a specific directory with:

    ls /some/path | wc -l
RDP via SSH (PuTTY)
Tags: linux, rdp, ssh, windows
Published: 2014-02-05 08:53:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: RDP via SSH (PuTTY)
slug: rdp-via-ssh-putty
date: 2014-02-05 08:53
tags: 
 - linux
 - rdp
 - ssh
 - windows
---
If you're like me, and you're paranoid about opening up access to your servers to the internet, you might sometimes find yourself needing to access them but not being on the local network. A handy trick to circumvent this, if you have access to SSH, is to open a tunnel.

For this we're going to need:  
- The IP or hostname and port of the destination server (for this they are `192.168.1.2` and `3389`)  
- Access to a server with SSH on the local network  
- PuTTY on your local machine  

First, open up either command prompt, or MinGW or something, and navigate to your PuTTY path:

    cd /c/PuTTY/

Then connect to the SSH server specifying a tunnel like so:

    putty.exe -L <localport>:<remotehost>:<remoteport> <sshserver>

For example:

    putty.exe -L 8001:192.168.1.2:3389 adamkdean.co.uk

This will open up a PuTTY window. Authenticate and open up another cmd/mingw prompt. In this one we're now going to use `mstsc` (remote desktop) to connect through the tunnel. We opened up port `8001` on our local machine, so lets connect to that.

    mstsc -v localhost:8001

If you've done everything right, you should now get a remote desktop prompt.

*Update from 11/02/2016:* You can tunnel connections with regular ssh like so: 

    ssh user@hostname -L <localport>:<host>:<remoteport> -N

`-L` is for your tunnel, and `-N` is no command executed on connect.
Port scanning with Netcat
Tags: nc, netcat, linux
Published: 2014-02-04 16:46:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Port scanning with Netcat
slug: port-scanning-with-netcat
date: 2014-02-04 16:46
tags: 
 - nc
 - netcat
 - linux
---
Netcat, or `nc`, is an excellent tool for linux. One thing it's great for is port scanning.

Let us say we want to scan for open ports from 1 to 1000, we can do that like so:

    nc -n -z -w 1 192.168.1.2 1-1000

`-n` prevents DNS lookup. `-z` will prevent Netcat from receiving any data. `-w 1` sets the timeout to 1 second.

You can also use `-v` to make it verbose, but this will obscure the visibility of successful attempts, which running it without shows.

An example output for the above command is:

> Connection to 192.168.1.2 80 port [tcp/*] succeeded!  
> Connection to 192.168.1.2 427 port [tcp/*] succeeded!  
> Connection to 192.168.1.2 515 port [tcp/*] succeeded!  

So useful!
Using exclamation marks in commit messages!
Tags: git
Published: 2014-01-27 13:51:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Using exclamation marks in commit messages!
slug: using-exclamation-marks-in-commit-messages
date: 2014-01-27 13:51
tags: 
 - git
---
If you've ever been particularly excited by a recent packet of work you've done, and tried to show your excitement by putting an exclamation mark into the commit message, then you may have been met with this particular error:

    git commit -m "I did some most excellent work!"
    sh.exe": !": event not found

You have two ways around this. One most excellent way is to use single quotes:

    git commit -m 'I did some most excellent work!'
    [branch 123abc] I did some most excellent work!
    1 file changed, 2 insertions(+)

Another way, if you require double quotes, is to add it onto the end with single quotes:

    git commit -m "I did some most excellent work"'!'
    [branch 123abc] I did some most excellent work!
    1 file changed, 2 insertions(+)

Unfortunately, simply escaping the character will not work, you will just end up with `\!`.
New blog powered by pelican
Tags: pelican, python, linux, wordpress
Published: 2019-08-08 13:03:01

---
title: New blog powered by pelican
published: true
tags: pelican,python,linux,wordpress
canonical_url: https://www.zufallsheld.de/2014/01/22/new-blog-powered-by-pelican/
---

I changed my blogging platform from [Wordpress](http://wordpress.org) to [Pelican](http://blog.getpelican.com/). Pelican is a static html generator written in Python. I also changed the whole design. It’s a bootstrap-theme with some little modifications.

The reason I changed from Wordpress is the effort to maintain a secure and up-to-date installation opposed to static html files with only minimal Javascript. Also there’s no need for me to use a full fledged CMS like Wordpress when all I want to do is write some blog-posts about technical things I like. Maybe I’ll also describe the process that is moving from Wordpress to Pelican.

~~There’s still [Piwik](http://piwik.org/) running in the background to gather some statistics about the posts I write. If you do not want to be tracked, you can opt out here[].~~

~~The commenting system is called [isso](http://posativ.org/isso/), a “leightweight disqus alternative” powered by Python.~~

So…if there are some glitches or things not working like expected, leave a comment or shoot me an email!
Change filename case in git
Tags: git
Published: 2014-01-20 13:55:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Change filename case in git
slug: change-filename-case-in-git
date: 2014-01-20 13:55
tags: 
 - git
---
Git is case-insensitive. So to change filename case in git, you have to jump through a (small) hoop.

    git -f <source> <destination>

Example:

    git -f src/helloworld.js src/HelloWorld.js

And that's it!
Install LESS highlighting in Sublime Text
Tags: less, sublimetext
Published: 2014-01-20 09:15:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Install LESS highlighting in Sublime Text
slug: install-less-highlighting-in-sublime-text
date: 2014-01-20 09:15
tags: 
 - less
 - sublimetext
---
Sublime Text doesn't come with LESS highlighting by default, but it's quite easy to install.

I've pulled the following from my previous blog post on [how to install Zen Coding/Emmet in Sublime Text](http://adamkdean.co.uk/blog/read/85/install-emmet-zen-coding-in-sublime-text).

> The first thing you want to do is open up Sublime Text. If you don't already have the package manager installed, then install it by bringing up the console `Ctrl` + `'` and pasting in:

> `import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())`

> Press enter and wait for that to install. Once complete, press `Ctrl` + `Shift ` + `P` to bring up the command palette and type `Install`, press enter to select `Package Control: Install package`. 

Once the menu appears, type `LESS` and select the first package.

Enjoy.
Kali Linux Amazon EC2 AMI
Published: 2023-08-21 21:17:09

---
title: Kali Linux Amazon EC2 AMI
published: true
date: 2014-01-20 00:00:00 UTC
tags: 
canonical_url: https://www.kali.org/blog/kali-linux-amazon-ec2-ami/
---

### Kali Linux in the Amazon EC2 Marketplace

**EDIT** : For updated Kali Rolling images in the Amazon AWS, check [this post](https://www.kali.org/blog/kali-linux-aws-cloud/).

After several weeks of “back and forth” with the Amazon EC2 team, Kali Linux has finally been approved into the Amazon EC2 marketplace. This means that our users can now activate and access Kali Linux instances in the Amazon cloud quickly and easily. We are “selling” these images on the marketplace for **free** , so other than the regular amazon charges, there no extras to pay. We have currently published a single 64 bit [minimal instance of Kali Linux](https://aws.amazon.com/marketplace/pp/B08LL91KKB), which can be found in the marketplace by searching for “Kali Linux” or accessed via its [direct link](https://aws.amazon.com/marketplace/pp/B08LL91KKB).

[![](https://www.kali.org/blog/kali-linux-amazon-ec2-ami/images/amazon-kali-marketplace.png)](https://www.kali.org/blog/kali-linux-amazon-ec2-ami/images/amazon-kali-marketplace.png)

Due to Amazon AMI image guidelines, the instance does not use the root account by default. Once you have obtained your SSH key from Amazon, you need to connect to your instance using the “kali” user, from which you can then sudo to root if needed. The image is a barebones Kali installation, allowing you to install any toolset you like, while still remaining small and lightweight. If you plan on using Kali Linux for any aggressive scanning on the Internet, make sure to update the Amazon security team through their [Penetration Testing Request](https://aws.amazon.com/security/penetration-testing/) form.

### Build Your Own Kali Images in the Amazon Cloud

If you would like to build your own Kali Linux Amazon Machine Images, you can use our [Kali cloud build-scripts](https://gitlab.com/kalilinux/build-scripts/kali-cloud) , which we published as part of our [Kali 1.0.6 release](https://dev.to/mohammadtaseenkhan/kali-linux-106-release-4951-temp-slug-7055758). These scripts can be edited to create your own custom images with whatever toolset you wish.

### Ask Us Anything on Reddit

Tomorrow, Tuesday 21st Jan, 2014 from 1300 - 1500 EST, we are conducting a [Reddit AMA](https://www.reddit.com/r/netsec/comments/1vryus/we_are_offensive_security_we_do_kali_linux/) (Ask Me Anything), revolving around OffSec, Kali Linux, and our other projects. You are welcome to join and ask us anything!
unite-haddockでhoogleをいい感じにプレビューする
Tags: vim, haskell
Published: 2014-01-19 16:16:00

---
title: unite-haddockでhoogleをいい感じにプレビューする
published: true
tags: Vim, Haskell
date: 20140119T16:16Z
canonical_url: https://qiita.com/shiena/items/1b6c97f32e3905e15c2b
---
# はじめに

vimと[unite-haddock](https://github.com/eagletmt/unite-haddock)プラグインを使うとhoogleでAPIを検索してブラウザでドキュメントを開くことができます。
これはこれで便利なのですが、vimからブラウザに切り替わるので若干の使いにくさを感じていました。
そこでドキュメントもvimでプレビューする機能を作成し、無事に取り込んでもらえました。

# 操作手順

## hoogleソースを開く

コマンドラインモードで以下のコマンドを実行します。
デフォルトは部分一致検索です。

```vim
:Unite hoogle
```

完全一致検索したい場合は引数に`exact`を追加します。

```vim
:Unite hoogle:exact
```
![cmdline.png](https://dev-to-uploads.s3.amazonaws.com/i/ptkdspmm1xtwwrf5x637.png)

## APIを検索する

部分一致検索で`google`を検索してみます。

![unite.png](https://dev-to-uploads.s3.amazonaws.com/i/zwwmetnoehsptwwsekr1.png)

## ドキュメントをプレビューする

ドキュメントを開きたいAPIにカーソルを移動して`p`を押すとプレビューウインドウに表示されます。
プレビューウインドウを閉じるときは`Ctrl-W Ctrl-Z`もしくは`:pclose`を実行します。

![preview.png](https://dev-to-uploads.s3.amazonaws.com/i/pksjerrs5wikfvpy05fl.png)

## プレビューを自動表示する

unite.vimの`-auto-preview`オプションを指定すると検索結果一覧にカーソルを移動するだけでプレビューを表示することができます。

```vim
:Unite -auto-preview hoogle
```
Plex for Chromecast
Published: 2021-01-28 21:44:58

---
title: Plex for Chromecast
published: true
date: 2014-01-19 12:00:00 UTC
tags: 
canonical_url: 
---

When Plex announced that it would be an official Chromecast partner, I knew that I had to get ahold of one. On Christmas day, I jumped onto Amazon and ordered one for £35.

![Chromecast](https://scottrobertson.me/img/posts/chromecast.jpg)

I had been using Plex for about 4 month before this, however I only had access to a very limited set of features due to using it as a DLNA device. I could browse the media (thumbnail and title) and play, and that was about it.

![Plex for Chromecast](https://scottrobertson.me/img//posts/plex-for-chromecast.png)

Getting the Chromecast has unlocked a lot more features that have made watching TV shows and Movies a whole lot nicer.

For example, I use [trakt.tv](http://trakt.tv/user/Scottymeuk) extensively, and with a simple plugin, Plex automatically sends what I am watching to Trakt. This means I can keep track of what I am watching, and even tell Plex to filter only "Unwatched" episodes/movies. This now works with stuff I watch on my TV thanks to their Chromecast support, so I no longer have to worry about marking things as watched manually with [an app](http://seriesgui.de/).

Another great advantage is being able to control your TV with basically any device in the house. I can pick my Mac up, choose a TV show and start watching, and then pick my phone up and turn the volume down on the TV. This makes everything seamless and much nicer to use.

Because it's all going through Plex, it also means that I could stop watching something halfway through, and pick up where I left off on my phone. For example, I could watch QI on the way home on the Metro, and finish watching an episode on my TV using Chromecast when I got in.

If you use Plex and have not yet got a Chromecast, then I really recommend it. It has made watching media a lot nicer experience overall. And if you do not use Plex, then try it out!

Let me know how you get on in the comments.

<!--kg-card-end: markdown-->
Use jQuery to see if an element exists
Tags: javascript, jquery
Published: 2014-01-17 10:28:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Use jQuery to see if an element exists
slug: use-jquery-to-see-if-an-element-exists
date: 2014-01-17 10:28
tags: 
 - javascript
 - jquery
---
You can use jQuery to see if an element exists by checking if the length of the jQuery object is > zero.

    var exists = $('.your-selector-here').length > 0;

Probably the shortest snippet so far.
Bind to public IP from an AWS EC2 instance
Tags: aws, ec2, linux
Published: 2014-01-15 11:24:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Bind to public IP from an AWS EC2 instance
slug: bind-to-public-ip-from-an-aws-ec2-instance
date: 2014-01-15 11:24
tags: 
 - aws
 - ec2
 - linux
---
One problem I have faced with Amazon Web Services EC2 instances is binding to a public IP or hostname. When you get an EC2 instance, you will have access to your local IP, and to your local hostname, but if you want to connect to the instance from an external source, you have to bind to a public interface.

There may be some fandangled way of using the AWS API to get your instance id and then from that, get your public hostname, but I have discovered a much easier way. 

Bind to `0.0.0.0`.

![sudo nc -l 0.0.0.0 80](http://i.imgur.com/zyYHkpi.png)

As you can see, I can now access it via my external browser.
Intercept AJAX requests
Tags: javascript, ajax
Published: 2014-01-14 09:57:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: Intercept AJAX requests
slug: intercept-ajax-requests
date: 2014-01-14 09:57
tags: 
 - javascript
 - ajax
---
Just a snippet today, a reblog, of an article on how to [Hijack AJAX Requests Like A Terrorist](http://verboselogging.com/2010/02/20/hijack-ajax-requests-like-a-terrorist) by [Daniel Huckstep](https://twitter.com/darkhelmetlive).

There are some who say not to modify prototypes because you never know how other libraries will use them, but then there are also some people who think that driving 30 MPH on a 60 MPH road is a good idea, so not everything everyone thinks is a good idea, is a good idea.

    (function(open) {
      XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
        // do some magic
        open.call(this, method, url, async, user, pass);
      };
    })(XMLHttpRequest.prototype.open);

This works perfectly well for intercepting AJAX requests. In my case, it is to modify the URL that is requested by AngularJS.
Passing the Hash with Remote Desktop
Published: 2023-08-21 21:17:11

---
title: Passing the Hash with Remote Desktop
published: true
date: 2014-01-14 00:00:00 UTC
tags: 
canonical_url: https://www.kali.org/blog/passing-hash-remote-desktop/
---

Kali Linux contains a large number of very useful tools that are beneficial to information security professionals. One set of such tools belongs to the **[Pass-the-Hash](https://dev.to/mohammadtaseenkhan/pass-the-hash-toolkit-winexe-and-more-1ph7-temp-slug-4417505)** toolkit, which includes favorites such as **pth-winexe** among others, already packaged in Kali Linux. An example of easy command line access using pth-winexe is shown below.

[![](https://www.kali.org/blog/passing-hash-remote-desktop/images/Screen-Shot-2014-01-14-at-9.53.44-AM.png)](https://www.kali.org/blog/passing-hash-remote-desktop/images/Screen-Shot-2014-01-14-at-9.53.44-AM.png)

We constantly strive to include new, useful tools to our repositories. Sometimes we feel that some of these tools do not get the attention they deserve and go under-reported. One such recent addition is the version of FreeRDP, which allows a penetration tester to use a password hash instead of a plain text password for authentication to the remote desktop service in Windows 2012 R2 and Windows 8.1.

What’s the big deal, you say? Traditional “Pass-the-Hash” attacks can be very powerful, but they are limited to command line access. Although in most cases that is enough, sometimes GUI access is just a better way to accomplish things.

A few months ago, Mark Lowe from the Portcullis Labs published a [blog post](https://labs.portcullis.co.uk/blog/new-restricted-admin-feature-of-rdp-8-1-allows-pass-the-hash/) on research he conducted against Windows 2012 R2 and Windows 8.1 RDP security improvements. It turns out that Microsoft, in their quest to mitigate “Pass-the-Hash” attacks, introduced something called “Restricted Admin” mode. You can read more about it [here](https://docs.microsoft.com/en-us/archive/blogs/kfalde/restricted-admin-mode-for-rdp-in-windows-8-1-2012-r2).

Inadvertently however, this new security feature actually enabled the use of a password hash for RDP authentication purposes, thereby giving many pentesters once again a reason to smile. To add to the validity of the research by Mark, the FreeRDP project has added native support for Pass-the-Hash authentication to the FreeRDP package, which is now in Kali repos. To enjoy this new feature, simply install freerdp-x11:

```
apt-get update
apt-get install freerdp-x11

```

The new xfreerdp executable supports the “/pth” flag as shown below using our “offsec” domain user and the “password” hash.

[![](https://www.kali.org/blog/passing-hash-remote-desktop/images/pth-rdp.png)](https://www.kali.org/blog/passing-hash-remote-desktop/images/pth-rdp.png)

And that’s it! RDP sessions using harvested password hashes. Again, keep in mind that this only works on Windows 2012 R2 and Windows 8.1. To the best of our knowledge, the “Restricted Admin” feature has not been backported yet and considering this, it may never be.
How to gitignore an existing file
Tags: git
Published: 2014-01-09 11:12:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: How to gitignore an existing file
slug: how-to-gitignore-an-existing-file
date: 2014-01-09 11:12
tags: 
 - git
---
You  have a file which you now want to ignore, such as a compiled css file, but git is already tracking it. 

First, add the path to your `.gitignore` file:

    src/path/to/file/style.css

Then, in git bash, we want to clear the cache, so run these commands:

    git rm -r --cached .
    git add .
    git commit -m ".gitignore is now working"

Now push your changes and be free of these bothersome files!

More info: http://stackoverflow.com/questions/11451535/gitignore-not-working
How to check jQuery version?
Tags: webdev, tutorial, jquery, javascript
Published: 2021-11-29 11:11:08

---
title: How to check jQuery version?
published: true
date: 2014-01-06 09:46:02 UTC
tags: webdev, tutorial, jquery, javascript, 
canonical_url: https://www.moreonfew.com/how-to-check-jquery-version/
---

Many of us might have come across scenarios wherein we wanted to do something based on the **version of the jQuery** loaded. To be specific I’m talking about scenarios where one might want to **know the version of jQuery programmatically**  and if the version was say 1.3.2 then load some other files too or do something else. Well, I must say that it is a very easy process to **identify jQuery’s version** , Let’s take a look at how to do it.

You can get to know the version of jQuery loaded by using the following:

```javascript
alert("jquery version = "+ $.fn.jquery);

//or 

alert("jquery version = "+ jQuery.fn.jquery);

//or 

alert("jquery version = "+ $().jquery);
```

##  How to check jQuery version in console?

Checking the version of jQuery through the console of firebug or any other browser-based console is also very easy. You can do it by typing the same code mentioned above in the console.

For e.g :  
Go to console and type

```javascript
$().jquery

//Or

$.fn.jquery

//Or

jQuery.fn.jquery
```

All of the above codes would give you the same result.

## How to detect / get jQuery UI version?

Detecting or Checking jQuery UI’s version is also quite simple. However, there was a slight change after version 1.6 was released. Let’s take a look at the code :

```javascript
/*Use this to check the version number in jQuery UI version 1.6 onwards*/
var jqueryUI_version = $.ui.version;

/*Use this to check the version number in jQuery UI prior to version 1.6*/
var jqueryUI_version = $.ui;
```

So go ahead and share your experience with other readers here. Also do tweet or share this post with your friends.

The post [How to check jQuery version?](https://www.moreonfew.com/how-to-check-jquery-version/) first appeared on [MoreOnFew](https://www.moreonfew.com).